How can I redirect to a specific url in php, based on the first number input?
If the first number entered in the form is 1
, then redirect to www.mysite.com/page1
, If the first number entered in the same form is 2
, then redirect to www.mysite.com/page2
.
The input field can have more than one number, but I want to redirect based just on first number.
I've tried this and doesn't work:
if ($number != '2') {
header("Location: http://example.com");
}