Hi,
I excute this simple script on my localhost:
http://localhost/phptut/story.html
<h3>Please fill in the blanks below, and I'll tell
you a story</h3>
<form method = "post"
action = "simple.php">
<table border = 1>
<tr>
<th>Color:</th>
<th>
<input type = "text"
name = "color"
value = "">
</th>
</tr>
<tr>
<td colspan = 2>
<center>
<input type = "submit"
value = "submit">
</center>
</td>
</tr>
</table>
I input value yellow and click the submit button.
Below is the simple.php code:
<table border = 1>
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
<tr>
<th>color</th>
<td><? print $color; ?></td>
</tr>
</table>
The result I get is in error:
Notice: Undefined variable: color in C:\Program Files\Apache Group\Apache2\htdocs\phptut\storySimple.php on line 9
"line 9" is <td><? print $color; ?></td>
I tried and tried but still can't figure out what went wrong.
Please advice.
Regards
Webken