PHP Form Changes??!!
| From: | James Brisland | Date: | Wed, 19 Jun 2002 11:59:19 +0000 |
| Subject: | PHP Form Changes??!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102911@lists.php.net to get a copy of this message | ||
Question everyone,
Have they changed the way PHP handles forms.
ie I used to post a text field through this form
<form action="<?$PHP_SELF?>" method="post">
<input type="text" name="name" value="value">
<inpt type="hidden" name="action" value="submited">
<input type="submit" value="Sumbit My Form">
</form>
<?
if($action == 'submited')
{
echo "$name : $value";
}
?>
But it seems that both using $PHP_SELF and also calling the posted vars by
their $name doesn't work. do I now have to do this... if so why the hell did
it change??
Regards, one very confused php'er
<form action="<?$_SERVER['PHP_SELF']?>" method="post">
<input type="text" name="name" value="value">
<inpt type="hidden" name="action" value="submited">
<input type="submit" value="Sumbit My Form">
</form>
<?
if($_POST['action'] == 'submited')
{
echo "$_POST['name'] : $_POST['value']";
}
?>