Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two actions on a form 1

Status
Not open for further replies.

peacecodotnet

Programmer
Joined
May 17, 2004
Messages
123
Location
US
I am trying to make a form that will do two things:

-send me an email with the persons name and what they want to buy
-go to the paypal web site so they can send me money

I know how to do both of these things, I just dont know how to do them both through one form. Can I set two different actions or something?
 
The "Form" itself has nothing to do with this. It is the script that is in the form action attribute that does the actions.
There virtually is no limitation what you make that script do. You can first send an e-mail and then redirect to the PayPal website using the header() command.
 
Tell me more about this header() command, I really have no idea what to do with this.

Peace out,
Peace Co.
 
Code:
header("Location: [URL unfurl="true"]http://wherever.com?param1=blah&param2=blah");[/URL]
Sending an HTTP header to redirect the browser to a different site. Any parameters can be sent as GET, if you want to spend more time you could also make the page POST to the destination URL but you need more in-depth HTTP protocol knowledge.
The most primitive use of header() is the above location directive, just to redirect the browser to another URL.

header() commands must be sent before any other output on the page or they will fail.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top