PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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?
Ambush Commander wrote:Erm, that shouldn't make a difference. However, the function is named wrong: it's header().
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.
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>