1
I am making a form that needs to reach my email but when someone clicks on Ubmit it is redirected to a thank you page. Grateful.
1
I am making a form that needs to reach my email but when someone clicks on Ubmit it is redirected to a thank you page. Grateful.
1
Create the page redirect.php - which will be the page that checks the form data and will redirect the user to the thank you page - and write the following code:
<?php
if (isset($_POST['submicao']))
{
<!-- faça a validação dos dados submetidos !-->
header('Location: http://seusite/agradecimento.php');
}
?>
On your form page, do a redirect page include right after the form submission
<html>
<head>
<!-- Código do header !-->
</head>
<body>
<form>
<!-- Seus labels, etc. do formulario !-->
<!-- Página de redirecionamento -->
<?php include "include/redirecionamento.php"; ?>
</form>
</body>
</html>
Or you can also use the following javascript code within the tag <form>
<form onsubmit="window.location.href='redirecionamento.php';">
In that case, you wouldn’t need to give the "include".
<body>
<form onsubmit="window.location.href='redirecionamento.php';">>
<!-- Seus labels, etc. do formulario !-->
</form >
</body>
</html>
Browser other questions tagged php html form
You are not signed in. Login or sign up in order to post.
but I put this in the middle of the <head>?
– Luvinicius
@Luvinicius edited the answer to be clearer
– regmoraes
Thanks, but in javascript is in the same position?
– Luvinicius
I changed the answer again :-)
– regmoraes
Thanks a lot man! :)
– Luvinicius