Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you're mixing up your priorities. For one, don't put the target id into those option values. Use plain values like '1', '2', '3' etc.</p> <p>The 'magic' happens in your evaluation method. First, evaluate whether home or office is selected.</p> <pre><code>if($_GET["home"] == 1) { //Assumes that selecting 'office' returns you this value. } else { } </code></pre> <p>Next, inside that selection, fill arrays with the target data.</p> <pre><code>$urls = array(); if($_GET["home"] == 1) { //Assumes that selecting 'office' returns you this value. $urls[] = "http://50.22.79.62/~pftech/water-delivery-service/" //rinse and repeat } else { $urls[] = "http://45.22.79.62/~pftech/water-delivery-service/" //rinse and repeat } </code></pre> <p>At this point, you have a valid array, which relates directly to the selected dropdownbox in dependance of the selected radiobutton.</p> <pre><code>$URL = $urls[$_GET["selection"]]; </code></pre> <p>Now you just need to pass that URL to your header function and you're good to go.</p> <p>Just for the sake of completeness, here's the suggested code:</p> <p>Handler:</p> <pre><code>&lt;?php if(isset($_GET['zip'])){ $sandiego = 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', '92562', '92563', '92590', '92591', '92592', '92596'); if (in_array($_GET['zip'], $sandiego)){ $urls = array(); if($_GET["home"] == 1) { //Assumes that selecting 'office' returns you this value. $urls[] = "http://50.22.79.62/~pftech/office_water-delivery-service/" $urls[] = "http://50.22.79.62/~pftech/office_coffee-delivery/" $urls[] = "http://50.22.79.62/~pftech/office_water-filtration-systems/" } else { $urls[] = "http://50.22.79.62/~pftech/home_water-delivery-service/" $urls[] = "http://50.22.79.62/~pftech/home_coffee-delivery/" $urls[] = "http://50.22.79.62/~pftech/home_water-filtration-systems/" } if($_GET['selection'] &lt; 3 &amp;&amp; $_GET['selection'] &gt;= 0) { $URL = $urls[$_GET['selection']]; header("Location: $URL?zip=$_GET[zip]"); } else header("Location: http://www.pureflo.com/"); //Illegal input } else { header("Location: http://www.pureflo.com/"); } } exit; ?&gt; </code></pre> <p>Your HTML for the selection box would look like this:</p> <pre><code>&lt;select id="selection" name="selection"&gt; &lt;option value='-1'&gt;Select a Service&lt;/option&gt; &lt;option value="0"&gt;Water Delivery&lt;/option&gt; &lt;option value="1"&gt;Coffee Services&lt;/option&gt; &lt;option value="2"&gt;Water Filtration&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload