2
Hello, I have an email registration code Newsletter and when putting wrong email or giving some error, I would like that instead of redirecting to the.html registration page, it redirects to the previous page, how can I do this?
The PHP Code looks like this:
<?php
include("config.php");
$email = $_POST["e-mail"];
$opcao = $_POST["opcao"];
$codigo = md5($email);
if($email == ""){
echo "<script>alert('Por favor, digite um email válido.');";
echo "location.href='cadastro.html'</script>";
} [..]
I don’t know if it can be done in JS or only in PHP itself.
Thank you all just for trying to help.