Page 1 of 1
Need some help with a submit button
Posted: Tue Dec 30, 2003 9:09 am
by rjmxracer1
Alright, I have a some what of a simple problem that has been bothering me for a while. I have this form made in HTML, at the end of it i have a submit button. I want the submit button to e-mail the answers to a person along with bring the viewer to another web page. Yet with HTML you can only define one action with the submit button. If anyone could give me an idea of what to do, or if there is a better way to do this simple task.
Thanks
RJ
Posted: Tue Dec 30, 2003 9:17 am
by Weirdan
In the php script you can first send email (perhaps using [php_man]mail[/php_man] function) then redirect the user to some page using [php_man]header[/php_man]("Location: somepage.php");
...
Posted: Tue Dec 30, 2003 1:18 pm
by kettle_drum
By using either POST or GET as the method in the form tag, along with the action being the address of the php script you can easily do it with mail(), and you could then simply include the thank you page, or whatever in the same script that mails the answers - theres no need to redirect - just make the script do both things.