Here is the code I am trying to execute:
<form action="who_are_you_advanced.php">
Please fill in the following fields:<br />
<?php
// Assign a value to favorite_language variable
$favorite_language = "PHP";
// GLOBAL first;
// GLOBAL last;
?>
<b>First Name:</b>
<input type="text" name="first" value="<?php print($first); ?>"
size="15"><br />
<b>Last Name:</b>
<input type="text" name="last" value="<?php print($last) ?>"
size="15"><br />
<b>Favorite Programming Language:</b>
<input type="text" name="favorite_language"
value="<?php print($favorite_language); ?>"
size="15"><br />
<input type="submit" value="Go!" size="15">
</form>
and, here is the output:
Please fill in the following fields:
First Name: [<br /><b>Notice</b>: Undefined variable: first in
<b>C:\Program Files\Apache Group\Apache
\htdocs\test\who_are_you_advanced.php</b> on
line <b>16</b><br /> ]
Last Name: [<br /><b>Notice</b>: Undefined variable: last in
<b>C:\Program Files\Apache Group\Apache2
\htdocs\test\who_are_you_advanced.php</b> on
line <b>19</b><br /> ]
Favorite Programming Language: [PHP ]
[Go button]
...
I tried uncommenting the Global variables and here is the output:
Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in C:\Program Files\Apache Group\Apache2\htdocs\test\who_are_you_advanced.php on line 11
...
Again, this on PHP 4.2.3 using Apache 1.3.23for Windows.
And, this is a copy from the same book in my prior post. I have register_global on in php.ini now, but now a different problem with text fields. To say the least, I'm learning alot through this forum!
I appreciate all input.