Jump to content
Fórum Script Brasil
  • 0

redirecionamento de formulario apos envio de dados?


josef

Question

Pessoal, eu tenho este php, que envia um formulario para o meu email, só que não consigo redirecionar para a pagina.html inicial após o envio do form...

<?php

//declare our assets

$name = stripcslashes($_POST['name']);

$emailAddr = stripcslashes($_POST['email']);

$comment = stripcslashes($_POST['comment']);

$subject = stripcslashes($_POST['subject']);

$contactMessage = "Message: $comment \r \n From: $name \r \n Reply to: $emailAddr";

//validate the email address on the server side

if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $emailAddr) ) {

//if successful lets send the message

mail("ejmortean@gmail.com", $subject, $contactMessage);

echo('success'); //return success callback

} else {

echo('An invalid email address was entered'); //email was not valid

}

?>

To tentando com o comando:

{

echo "<script>

alert('Mensagem enviada com sucesso! Em breve estaremos respondendo.');

window.location.href = 'http://www.tisolucoes.net.br';

</script>";

}

Já coloquei em todo lugar mas não redireciona

Alguma dica? :rolleyes: :blink:

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...