Page 1 of 1

How do we create a link to another page after the submit?

Posted: Fri Jul 07, 2006 8:32 am
by joseph
This codes below is a portion of what I've pasted from my feedback.php . I already have the $headers declared above,
it means that I can't use another header function below.. so what should I do to redirect to another page after the feedback form is sent?

Code: Select all

$headers   = "From: $FirstName $LastName \r\n";
$headers  .= "Reply-To: $Email";

if (mail($recipient,$subject,$message,$headers)) {
 headers ("Location: http://www.name.html");
} else {
   echo "<p>I'm sorry $Title $FirstName $LastName, Mail NOT sent this time.</p>";   
}

Posted: Fri Jul 07, 2006 8:58 am
by Ambush Commander
Erm, that shouldn't make a difference. However, the function is named wrong: it's header().

Posted: Tue Jul 11, 2006 8:03 pm
by joseph
Ambush Commander wrote:Erm, that shouldn't make a difference. However, the function is named wrong: it's header().
:D could you give me an example? I can't seem to make it work redirect it after mail has been sent. It has to redirect to another html page saying that the mail has been sent.

Posted: Tue Jul 11, 2006 8:10 pm
by bdlang
I'm assuming that's an example, because the domain http://www.name.html isn't going to work, it should be http://www.name.com/page.html

Code: Select all

if ( something good happened ) {
    header("Location: http://www.name.com/page.html");
} else {
    echo 'something bad happened, unfortunately.';
}

Posted: Wed Jul 12, 2006 8:52 pm
by joseph
bdlang wrote:I'm assuming that's an example, because the domain http://www.name.html isn't going to work, it should be http://www.name.com/page.html

Code: Select all

if ( something good happened ) {
    header("Location: http://www.name.com/page.html");
} else {
    echo 'something bad happened, unfortunately.';
}
Thanks but it still has the error, it says that the heads is already declared above. Something like that since I already have $headers. Maybe I could just put a link instead.. like

echo 'mail sent successfully';
<a href=" ">www.site.com </a>