php-db Form var perpetually resetting
| From: | Mignon Hunter | Date: | Mon, 09 Jun 2003 20:57:01 +0000 |
| Subject: | php-db Form var perpetually resetting | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28452@lists.php.net to get a copy of this message | ||
hello all
I am trying to customize a shopping cart. I need to inject a page in
the checkout process that must be checked (terms and conditions), before
continuing.
I have it working halfway. In checkout_payment.php I have an if stmt
*************************************************************************
//if terms and conditions hasnt been checked redirect to conditions.php
if ($HTTP_POST_VARS['agree'] != 'true') {
tep_redirect(tep_href_link(FILENAME_CONDITIONS, '', 'SSL'));
}
*************************************************************************
So - if you go to checkout_payment and that box hasnt been checked it'll
send you to conditions.php. If you go to conidtions.php and dont check
the box - the page keeps reloading, which is ok for now.
In conditions.php I have
*************************************************************************
<form name="conditions" action = checkout_payment.php method="post">
<tr><td><?php echo
tep_draw_checkbox_field('agree','true');?>Check
this box to accept Terms and Conditions</td>
<td align="right" class="main"><br>
<input type= "submit" value = "continue"></td></tr>
</form>
*************************************************************************
If the box is checked it goes to checkout_payment.php Ok, but when you
click continue from checkout_payment it goes back to conditions.php like
the variable has been reset to false. (I think) Essentially because the
script is running again I guess.
Should I try to set this var in the session ? Or do a simple javascript
validation in conditions.php ???
Any suggestions greatly appreciated.
--
Mignon Hunter
Web Master and Developer
Toshiba International
713.466.0277 x 3461