im getting the following error message
Notice: Undefined index: action in C:\Program Files\Apache Group\Apache2\htdocs\steve\8-3.php on line 2
The problem is that a friend of mine is running the same thing and does not get that error message.
We are using the same version of apache and php. I probably didnt setup something right in a config file somewhere but we both cant figure out what.
Does anyone know why I am getting the error message?
the 8-3.php code:
<?php
if ($HTTP_POST_VARS['action'] == 'submitted') {
print '<pre>';
print_r($HTTP_POST_VARS);
print '<a href="'. $HTTP_SERVER_VARS['PHP_SELF'] .'">Please try again</a>';
print '</pre>';
} else {
?>
<form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
Name: <input type="text" name="personal[name]">
Email: <input type="text" name="personal">
Beer:
<select multiple name="beer[]">
<option value="warthog">Warthog</option>
<option value="guinness">Guinness</option>
<option value="stuttgarter">Stuttgarter Schwabenbräu</option>
</select>
<input type="hidden" name="action" value="submitted">
<input type="submit" name="submit" value="submit me!">
</form>
<?php
}
?>
Notice: Undefined index: action in C:\Program Files\Apache Group\Apache2\htdocs\steve\8-3.php on line 2
The problem is that a friend of mine is running the same thing and does not get that error message.
We are using the same version of apache and php. I probably didnt setup something right in a config file somewhere but we both cant figure out what.
Does anyone know why I am getting the error message?
the 8-3.php code:
<?php
if ($HTTP_POST_VARS['action'] == 'submitted') {
print '<pre>';
print_r($HTTP_POST_VARS);
print '<a href="'. $HTTP_SERVER_VARS['PHP_SELF'] .'">Please try again</a>';
print '</pre>';
} else {
?>
<form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
Name: <input type="text" name="personal[name]">
Email: <input type="text" name="personal">
Beer:
<select multiple name="beer[]">
<option value="warthog">Warthog</option>
<option value="guinness">Guinness</option>
<option value="stuttgarter">Stuttgarter Schwabenbräu</option>
</select>
<input type="hidden" name="action" value="submitted">
<input type="submit" name="submit" value="submit me!">
</form>
<?php
}
?>