Jump to content

stallonmabro

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by stallonmabro

  1. Pls, how can i get this php code to redirect to the first header location url whenever the user input matches anyone of the numbers in the $tracking = array, and redirects to the second header location whenever the user input doesnt match any of the numbers in the $tracking = array.

     

    <?php
        $tracking = $_post['tracking']; //your form method is post

        $tracking = array('91911', '91914', '91915', '91932', '91942', '91945', '91950', '92014', '92025', '92027', '92029', '92037', '92064', '92065', '92067', '92071', '92075', '92101', '92102', '92103', '92104', '92105', '92106', '92107', '92108', '92109', '92110', '92111', '92113', '92114', '92115', '92116', '92117', '92118', '92119', '92120', '92121', '92122', '92123', '92124', '92126', '92127', '92128', '92129', '92130', '92131', '92132', '92134', '92135', '92139', '92140', '92145', '92147', '92154', '92173');

        if (in_array($tracking, $tracking)){
            header("Location: http://queensdeliverys.com/".$_post['selection']);
            exit;
        } else {
                header("Location: http://www.pureflo.com");
                exit;
       }

     

     

    this is the html form action and method details.

     

    <form action="/QDS-tracking/validate.php" id="search-form" method="get" name="tracking"><input class="s-f-input search" id="order_number" name="TrackingModel[order_number]" placeholder="Enter your Order Number" tabindex="1" type="text" /><input class="search-btn" name="yt0" type="submit" value="Track" /></form>

    ?>

     

    any help will be greatly appreciated, thanks

     

     

     

    this is the link you can test the code on.

     

    queensdeliverys.com/QDS-tracking/tracking.html

     

    and it should redirect to http://queensdeliverys.com if the code is fixed, and http://www.pureflo.com if it isnt fix yet.

     

     

    thanks!!

×
×
  • 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.