I'm trying to figure out how to modify the script from this existing subscribe form:
HTML
<form method="post" action="subscribe.php">
<input type="text" name="email"/>
<input type="submit" value="Submit" class="submit-btn">
<input type="hidden" name="success" value="test-success.html">
<input type="hidden" name="error" value="test-error.html">
</form>
PHP
if (preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/', $email))
{
if ($result && !empty($successUrl))
{
header( "Location: $successUrl") ;
}
else if (!empty($errorUrl))
{
header( "Location: $errorUrl") ;
}
else
{
echo 'Error';
}
}
else if (!empty($errorUrl))
{
header( "Location: $errorUrl") ;
}
else
{
echo 'Error';
}
exit();
}
?>
Rather than redirecting to the success/error page, I would like to show the message via popup.
The popup that I'm using is the Magnific Popup.
http://dimsemenov.com/plugins/magnific-popup/documentation.html
I've tried to edit the values from the input type & add in the popup link however it doesn't work tat way. I'm not good at php scripts either, may I know how should I make it work?