Re: Asking for help...
| From: | Bas Jobsen | Date: | Thu, 08 Aug 2002 20:55:32 +0000 |
| Subject: | Re: Asking for help... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111739@lists.php.net to get a copy of this message | ||
Op donderdag 08 augustus 2002 23:22, schreef Ashley M. Kirchner:
> DELETES another field and resubmits. At this point, that variable
> was already registered, and deleting the value from the form has no
> effect. The old value is still there and gets submitted. I need
> to check for this somehow.
You shouldn't register before the form is complete right and not after every
submit.
something
like:
<?
$error='';
if(isset($_POST['yes']))
{
if($_POST['field1'])!=1)$error='field1 is not1 !';
etc...
}
if(empty($error))
{
session_start();
$_SESSION['field1']=$_POST['field1'];
header(Location: next_page);
exit;
}
if(!empty($error)){ echo error.'<br>'}
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input type="text" name="field1"
value="<?=isset($_POST['field1']) ?
$_POST['field1'] : ''?>">
etc........
<input type="sumbit" name="yes">
</form>