You can do the same thing with the $_POST['variable'];
statement. Now I've ran into some other problems with this problem, so right now I'm using a trick to declare a value in the beginning of my statements giving the name as they appear in the book. for example on page 117 my php code reads following:
<?php
$Question1 = $_POST['Question1'];
if ($Question1=="Lisabon") echo "You are Correct, Lisabon is the right Answer";
if ($Question1!="Lisabon") echo "You are incorrect, Lisabon is the right Answer";
?>
Note that there's a typo in the book with the second answer.
Hope this helps you.
- Something is for free, if you never have to pay for it -
|