Hi All,
I have the below code which redirects to specific URLs once a code is entered on our website. If the code is incorrect it taking the customer to a ‘This Page cannot be displayed’ which is not correct. I really want the customer to stay on the page with the promo box with an error message saying incorrect code - this is not happening, any idea why?
Thanks in advance
[php]<?php
$errmsg = “”;
if(empty($_POST[‘pode’])) {
$errmsg = ‘Enter promotional code’;
} else {
switch($_POST[‘pcode’]) {
case “code123”:
$redirectpage = ‘http://www.website.com’;
break;
case “code456”:
$redirectpage = ‘http://www.website.com’;
}
header(“Location: $redirectpage”);
}
?>[/php]