I want a form variable $coupon to persist after a user enters the value in the form and clicks submit.
If I register the variable first, then it can't be overridden by the form.
If I submit the variable as $coupon_check, then check the submitted form with something like
if ($submit)
{
if ($coupon_check == "foobar")
{
session_start ();
session_register ('coupon');
$coupon = ('foobar');
}
else
{
redisplay the form with a message saying the value entered was incorrect.
}
}
in this case $coupon is registered as foobar, but it isn't passed on to subsequent pages when I check with
<? echo $coupon ?>
Any ideas what I'm doing wrong, or a better way to approach this?