Nikhil Kumar bio photo

Nikhil Kumar

A stylish blog on my code

Google+ Gmail LinkedIn Github Résumé



I decided to spend the beginning of my winter break learning how to use Heroku. I decided to make my first program a zork game that uses Heroku to run the Zork game in a local bash shell. I have learned several things in the process and added a really cool game to my website.

Check it out

Check out the game here

Form handling

One thing I learned from this project is how to handle form handling. This takes data entered in the html and gives it to another script.

You can enter the data using a form tag.

<form name="prompt" action="zork.php" method="post">
<input class="prompt" type="text" name="inputPrompt" autocomplete="off">

You can then retrieve the data in php like so:

$inputPrompt = $_POST["inputPrompt"];

Now the inputed string is in inputPrompt.