2 submit buttons on 1 form?
Posted: Sat Jul 06, 2002 1:13 pm
Hi PhP's(peeps)
Is it possible to submit form results to 2 diffrent pages depending on selections or conditions made in the form?
It's a simple login form. NAME, EMAIL, PASSWORD. There is a password hint field in the database. I want to have the user enter NAME, EMAIL and PASSWORD to go to page A by using "SUBMIT" OR enter just NAME and EMAIL and get back a password hint (printed right on the login form) by using a second "GET HINT" submit button. I would like to use just one form so the user dosen't have to reenter the NAME, EMAIL twice.
I'm thinking maybe
It kind of works, but runs through the form twice.(The second time actually sets the action. Any way to get "page_A.php" to function as a defualt action URL and go through on the first try? I don't care if the second choice runs the form again.
Hope I was clear enough.
Any questions, just ask.
Thanks for any help at all
Virgil
Is it possible to submit form results to 2 diffrent pages depending on selections or conditions made in the form?
It's a simple login form. NAME, EMAIL, PASSWORD. There is a password hint field in the database. I want to have the user enter NAME, EMAIL and PASSWORD to go to page A by using "SUBMIT" OR enter just NAME and EMAIL and get back a password hint (printed right on the login form) by using a second "GET HINT" submit button. I would like to use just one form so the user dosen't have to reenter the NAME, EMAIL twice.
I'm thinking maybe
Code: Select all
<form method=POST action=<?=$send_data;?>
<input type="submit" value="Send to page A" name="page A">
<input type="submit" value="Send to page B" name="page B">
IF (isset($page A)) {
$send_data="page_A.php"
}
IF (isset($page B)) {
$send_data="page_B.php"
}Hope I was clear enough.
Any questions, just ask.
Thanks for any help at all