RE: [PHP] form redirect
| From: | Jerry Lake | Date: | Thu, 09 Nov 2000 19:36:29 +0000 |
| Subject: | RE: [PHP] form redirect | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24543@lists.php.net to get a copy of this message | ||
Thanks, I've got it going now
Jerry Lake
-----Original Message-----
From: Philip Olson [mailto:philip@theprojects.org]
Sent: Thursday, November 09, 2000 10:34 AM
To: Jerry Lake
Cc: php-general@lists.php.net
Subject: Re: [PHP] form redirect
Hi. I don't see this on order form but think you should :
Thus far you have this :
----<snip>-------
I Agree
<input type="radio" name="agree" value="I
Agree">
I Do Not Agree
<input type="radio" name="agree"
value="Disagree"><br><br>
----</snip>------
So to make that work you could do this:
1. Change value "I Agree" to "yes"
2. Change value "Disagree" to "no"
3. Do something like this :
<?php
if ($agree == 'yes')
{
// do this you put this on top as it is the
// most likely choice
}
elseif ($agree == 'no')
{
// do this
}
else
{
// do this
}
?>
A good way to debug such things is to make your form type=get and scour
the Query_String (URL) to see what's up. You are confusing names and
values... Hopefully the above explains this. Remember in url :
name=value
Btw, you'll want to add some checks too as currently one can leave
everything blank yet still get to this agreement form.
Philip
--
be outside the box.
On Thu, 9 Nov 2000, Jerry Lake wrote:
> I am trying to set up a form redirect
> based off the premise that either the
> select an "agree" radio button and
> the order gets submitted and follows through
> or the select the "disagree" radio button and
> they get redirected to a thanks anyway page
>
> I've got it structured like this
> but I cant seem to get the results I want
> for when disagree is selected. here is the sample
> http://www.pacifier.com/save/newdsl_order.html
>
> <?
> if (!$agree)
> {
> do this
> }
> elseif ($disagree)
> {
> do this other thing
> }
> else
> {
> do this thing
> }
> ?>
>
> any thoughts are appreciated.
> Jerry Lake
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net