I am converting some old CGI Perl code over to PHP, and the oddest problem is occuring. First the platform is Linux 2.4.5 running Apache 1.3.20 and I just installed PHP 4.3.2 on it. I am able to run PHP commands with no problem whatsoever, and even can connect to and pull information from the MySQL database that is on this machine. HOWEVER, while the old Perl CGI scripts process form input beautifully, I can not get ANY PHP code to work with form input. This is junior, junior stuff, but I can't seem to make it work. Below is a test PHP document that runs, but the variables NEVER get processed. Basically what happens is that the user can input data, click the submit button, and it does NOT display the input data, because it was never "submitted" to the environment variable. Am I missing a statement in either the php.ini or httpd.conf file to make this work?
Thanks in advance for any help!
<html>
<head>
<title>Test Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php if (!$HTTP_POST_VARS['submit']) { ?>
<form action="test.php" method="post">
<table width="75%" border="0">
<tr>
<td>Name:</td>
<td><input name="name" type="text"></td>
</tr>
<tr>
<td>Comments:</td>
<td><textarea name="comment" cols="" rows=""></textarea></td>
</tr>
<tr>
<td><input name="submit" type="submit"></td>
<td><input name="reset" type="reset"></td>
</tr>
</table>
</form>
<?php } else { ?>
<table width="75%" border="1" cellspacing="5" cellpadding="5">
<tr>
<td width="39%">Name</td>
<td width="61%"><?php echo $HTTP_POST_VARS['name']; ?></td>
</tr>
<tr>
<td>Comments</td>
<td><?php echo $HTTP_POST_VARS['comment']; ?></td>
</tr>
</table>
<?php } ?>
</body>
</html>