[color=black]Hi People:[/color]Kirupa posted this PHP mail tutorial a bit ago. His code goes like this:
[color=#0000ff]<?[/color][color=#000050]php[/color] [color=#006610]if[/color]color=#0000ff[/color] [color=#0000ff]{[/color] [color=#000050]$to[/color] [color=#0000ff]=[/color] [color=#666666]“you@you.com”[/color]; [color=#000050]$subject[/color] [color=#0000ff]=[/color] [color=#666666]“Form Tutorial”[/color]; [color=#000050]$name_field[/color] [color=#0000ff]=[/color] [color=#000050]$_POST[/color][color=#0000ff][[/color][color=#666666]‘name’[/color][color=#0000ff]][/color]; [color=#000050]$email_field[/color] [color=#0000ff]=[/color] [color=#000050]$_POST[/color][color=#0000ff][[/color][color=#666666]‘email’[/color][color=#0000ff]][/color]; [color=#000050]$message[/color] [color=#0000ff]=[/color] [color=#000050]$_POST[/color][color=#0000ff][[/color][color=#666666]‘message’[/color][color=#0000ff]][/color]; [color=#000050]$body[/color] [color=#0000ff]=[/color] [color=#666666]“From: $name_field
E-Mail: $email_field
Message:
$message”[/color]; [color=#000050]echo[/color] [color=#666666]“Data has been submitted to $to!”[/color]; [color=#000050]mail[/color][color=#0000ff]([/color][color=#000050]$to[/color], [color=#000050]$subject[/color], [color=#000050]$body[/color][color=#0000ff])[/color]; [color=#0000ff]}[/color] [color=#006610]else[/color] [color=#0000ff]{[/color] [color=#000050]echo[/color] [color=#666666]“blarg!”[/color]; [color=#0000ff]}[/color] [color=#0000ff]?>[/color] Once you set all your info, you put your page on the net and when you submit the form, it displays a page with a message saying your data has been submitted to whatever address you chose, right?
I’d like, after submitted the message, to redirect the page to the same contact page, or for example, to another page in the site. Not to display the page with the echo command.
Can anybody teach me how to modify the PHP code to do just that?
The address to the tutorial is http://www.kirupa.com/web/php_contact_form2.htm
for your reference.
Thanks in advance for your help.
Keep up your great work.