Forum Moderators: coopster

Message Too Old, No Replies

PHP Form to email...Newbie question...

         

ExtremeExports

12:27 am on Aug 19, 2003 (gmt 0)

10+ Year Member



Okay, I have a form, to which I have sent to my email. I would like this form to be sent to my email, but then have the sender sent to a php page that I specify. This page is to get the user's name from the form and greet the user. I've gotten to where it will poste the information filled out in the form to go to my email, but I can't get it to take the name the customer filled in in the form on the page it sends to after the form is submitted. Does that sound confusing? I hope someone can help me. Thanks!

jatar_k

2:04 am on Aug 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe pass the name in the url when you send them off to the welcome page or include the welcome page so that the variable containing their name is still available.

do you send them to another page once the email is sent?

MWpro

2:46 am on Aug 19, 2003 (gmt 0)

10+ Year Member



If the purpose of the next page is just to thank/greet the user, then you can put the php code that processes the form on that new page, and make that page the form action. That way it will send the email, and you can just do a simple:
echo "Thank you $name for your comments";

jamesa

8:52 am on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ditto what MWpro. You could also use a header redirect with a query string variable (i.e.-
header("otherpage.php?name=$name");
) if you have to, but it's much better application design to do it the way MWpro suggested if you can.

jonknee

5:46 pm on Aug 19, 2003 (gmt 0)

10+ Year Member



A tip if you decide to do the header("Location:$site") route--this has to be above all output or you'll get an error.

ExtremeExports

10:27 pm on Aug 19, 2003 (gmt 0)

10+ Year Member



Thanks everyone! I got it to work. Much appreciated.