Hi friends, I am using form to email with the help of php. The code is fine but I want some changes to the result page. I am new to this so please help. Here is the truncated code. echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold">Mail has been sent Successfully.<br /></font>'; } else { echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold">Wrong file format. Mail was not sent.</font>'; } ?> Code (markup): I wanted that if the mail is send, ie. "Mail has been sent Successfully" then it should go to thankyou.html if not then to the form.html again.
I think you'd like to redirect your visitors depending on the result of a form submission.... right? If it's that so, redirect in php can be done like : if ( CONDITION ) { header("Location: http://www.example.com/"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; } else { header("Location: http://www.something.com/"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; } PHP: NOTE : Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.