So, I want to redirect a page after send the email, however, this redirect should have parameters in the url (id=1 or 2 or 3).
function getMarc() {
return $_GET['id'];
}
This code gets the id.
Then, first I've to check if there's empty fields and after that redirect the page according to the url.
However, this is not redirecting and is sending me a email even if the fields are empty, and shouldn't!
if (empty($name) || empty($marc) || empty($phone) || empty($model) ||
empty($email)) {
echo "<script type='text/javascript'>window.alert('Please do not leave empty fields')</script>";
echo "<script type='text/javascript'>window.location='main.php?id=" . getMarc() . "' </script>";
} else {
if ($send_contact) {
echo "<script type='text/javascript'>window.alert('Message sended.')</script>";
echo "<script type='text/javascript'>window.location='main.php?id=" . getMarc() . "'</script>";
} else {
echo "<script type='text/javascript'>window.alert('Error sending.')</script>";
echo "<script type='text/javascript'>window.location='main.php?id=" . getMarc() . "'</script>";
}
}
What could be wrong? Thanks.

New Topic/Question
Reply




MultiQuote






|