Jump to content

murray price

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by murray price

  1. Its ALIVE! Thanks for all your help... <?php $valid = array('kt18','sm3','sw11','etc'); $lowercase_postal = strtolower($_POST['postcode_area']); if( in_array($lowercase_postal, $valid) ) { header("Location: ../area-covered.htm"); exit(); } else { header("Location: ../area-not-covered.htm"); exit(); } ?>
  2. Hi, Thanks. I have changed the echo's to header to redirect to a new page but when I add any search now it just directs to the fail page. <?php $valid = array('kt18','sm3','sw11','etc'); $lowercase_postal = strtolower($_POST['postal_code']); if( in_array($lowercase_postal, $valid) ) { header("Location: ../area-covered.htm"); exit(); } else { header("Location: ../area-not-covered.htm"); exit(); } ?>
  3. I've got no idea how to do that
  4. It is just list like: kt18 sm3 sw11 etc The person will only be entering the first block of their postcode and their are about a 100 of these. Thanks
  5. Hi, I am trying to put together a script that allows visitors to my site to enter a postcode in a search box and then if the postcode matches one that is on a list the visitor is sent to a success page if not a fail page. This is the script I have so far: <?php $postcode_area = "kt18"; if(isset ($_POST["postcode_area"])){ if($_POST["postcode_area"] == $postcode_area){ header("Location: ../area-covered.htm"); exit(); } else{ header("Location: ../area-not-covered.htm"); exit(); } } ?> This works fine if the user enters the one postcode shown 'KT18' but I have about 100 I want to include for the script. Can anybody help me we out with this? I kinda know that I need to do a for each loop and explode it but I am just not advanced enough yet to pull this one off! Thanks for any help
  6. How would I modify this script so someone is sent to a success page if they enter any 1 of 100 postal codes that I add into the script or a fail page if a postal code they enter is not listed in the script?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.