I think there is either an error in my code, or my PHP or Apache is not configured correctly.
When I submit a form with a hidden field, I get no data in my $ _POST array ...
When I comment on a hidden field in my code, the POST data will return correctly ...
HTML FORMAT
<form action='/utils/login.php ' method='POST'>
<table>
<tr>
<td colspan='2'>
Login
</td>
</tr>
<tr>
<td>
Username
</td>
<td>
<input type='text' name='userid' value='' size='12' />
</td>
</tr>
<tr>
<td>
Password
</td>
<td>
<input type='password' name='password' size='12' />
</td>
</tr>
<tr>
<td>
<input type='hidden' name='formtype' value='login' />
</td>
</tr>
<tr>
<td>
<input type='submit' value='Submit' />
</td>
</tr>
</table></form>
Here is the code that processes it in PHP ...
foreach ($_POST as $var => $value) {
echo "$var = $value<br>";
}
I am using PHP 5 and Apache 2.2 on my server.
Any ideas?
EDIT ...
I narrowed it down to this ...
$command = $_POST['formtype'];
When I removed the @ sign from my $ _POST, I get the following error ...
Note: Undefined: formtype variable in C: \ webroot \ utils \ login.php on line 17
If I comment on this line, the POST data is passed to the program without problems.