Monday, February 20, 2012

Graphics Version

I want to create a graphics version, and I am absolutely sure that would be much more enjoyable to play. I've been thinking for some time about which library and engines to use, but I haven't been able to make a decision yet. When I start making progress then I'll be sure to release some information. If you find any bugs or have any suggestions -besides about graphics- then please post them either here or as an issue on my google code page (which I have linked to in the sidebar). Just a heads up: I recently received a subdomain from heliohost.org so I moved all my blogs to that domain, however you may still reach this site from the old url ( ez-squeeze.blogspot.com ).

Thursday, February 2, 2012

PHP

I tried my luck at PHP today. The problem was to be able to create a form and have it post to a blog. Thus allowing any viewer to post to that blog. So the concept was similar to that of mlib, fml, etc. But how can someone do that for free? Or without designing a whole website in ruby on rails? Simpler than I thought.
Here's what I did:
Create an html form:
 <html>
<body>
<form method="post" action="mailer.php">
<p>Title:<input type="text" id="title" name="title" size="19"></p>
<p>Message:</p>
<textarea rows="9" name="message" cols="30" id="message"</textarea><br>
<input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset">
</form></body></html>
Which then links to a PHP file that handles it:

 <?php
$to = "to_email@site.com";
$subject = $_POST['title'];
$message = $_POST['message'];
echo "submitting... \n";
$headers = 'From: default <from@email.com>' . "\r\n";
mail($to, $subject, $message, $headers) or die("failure");
echo "done\n";
echo "redirecting in 5 seconds, otherwise click";
sleep(5);
echo "<a href=\"http://mlipro.blogspot.com\">here</a>\n";
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=http://mlipro.blogspot.com">';
?>

For the TO address, change your blog mobile/email settings to accept posts from a "secret" email, and use that address.  
Next, upload both files to the same directory on a PHP enabled server, and link to the form on your blog.
The website: mlipro.blogspot.com