Presumably there are only two page options, one for known customers and one for others?
Assuming customer numbers kept on a database and form using method='post'.
Your
php code needs to do the following:
The code must start with; ob_start(); This buffers the header output until you have made up your mind what you want to do.
- Code: Select all
$custnum = $_POST['custnum'];
... additional code
- Code: Select all
$query = 'select id from customers where custnum ='.$custnum;
... more code
- Code: Select all
if ($rows == 1){
header('Location: http://domain.co.uk/customer.html');
}
else {
header('Location: http://domain.co.uk/notcustomer.html');
}
... anything else you want to do
And finally:
- Code: Select all
ob_end_flush();
Sends the header to the browser and the redirection takes place.