PHP Script error
-
Hi friends,
I am using a custom php script in my wordpress website. my aim is to redirect the user to error page when the filled form is empty or with any wrong value.
He should go to success page when he filled the form with correct text. The correct text is for example anytext. But i am getting error constantly.
Can anyone please check that what the error is and how to correct it?<?php
$answer = $_POST[‘answer’];if ($answer == 0 )
{
header(“Location: https://www.domain.com/error”);
exit;
}if ($answer == anytext )
{
header(“Location: https://www.domain.com/success”);
}
else {
header(“Location: https://www.domain.com/error”);
exit;
}
?>Any help please. Thanks in advance.
- The topic ‘PHP Script error’ is closed to new replies.