PHP Newbie - Form Help


New here and looking for a bit of help or at least pointing in the right direction. I am fairly new to PHP and at the moment just banging my head against the desk with this lol

Basically what I am trying to do is create a one field form and when it submits it redirects to a different url and no database, the more complicated bit (for me any way) is I want it to redirect to different url’s for different codes entered…for example I enter HNNN and it redirects to , I enter JJGSand that redirects to

Is this even possible, I’m sure it is and I think just need pointing in the redirection. I am really new to PHP so learning slowly as I go along.

Thanks in advance.


What you can do is the following:

[code]$location = “”;

if ($_POST[‘form_element’] == “someValue”) {
$location = “”;
} elseif ($_POST[‘form_element’] == “someOtherValue”) {
$location = “”;

header("Location: ".$location);

Sponsor our Newsletter | Privacy Policy | Terms of Service