Jump to content

Form variables not passing to next page


Go to solution Solved by oracle765,

Recommended Posts

<!-- ID of the form you want to attach the CompareToStrip to. -->
<form id="cruisesForm" action="demo_form.php" method="post">
    <!-- cruise destination ID and length ID -->
    <select id="destinationID">
        <option value="1">Africa</option>
        <option value="2">Alaska</option>
        <option value="3">Aisa</option>
        <option value="4">Bahamas</option>
        <option value="5">Bermuda</option>
        <option value="6">Canada - New England</option>
        <option value="7">Caribbean</option>
        <option value="8">Caribbean - Eastern</option>
        <option value="9">Caribbean - Southern</option>
        <option value="10">Caribbean - Wstern</option>
        <option value="11">Europe</option>
        <option value="12">Hawaii</option>
        <option value="13">Mediterranean</option>
        <option value="14">Mediterranean - Eastern</option>
        <option value="15">Mediterranean - Western</option>
        <option value="16">Mexico</option>
        <option value="17">Nowhere (no port stops)</option>
        <option value="18">Panama Canal</option>
        <option value="19">South America</option>
        <option value="20">South Pacific</option>
        <option value="21">Transatlantic</option>
        <option value="22">United States & Canada</option>
        <option value="23">US Pacific Coast</option>
        <option value="24">World</option>
    </select><br /><br />
    
        <!-- departure month and year -->
    <select id="departMonth">
        <option value="1">January</option>
        <option value="2">February</option>
        <option value="3">March</option>
        <option value="4">April</option>
        <option value="5">May</option>
        <option value="6">June</option>
        <option value="7">July</option>
        <option value="8">August</option>
        <option value="9">September</option>
        <option value="10">October</option>
        <option value="11">November</option>
        <option value="12">December</option>
        
    </select> 
     
    <select id="departYear">
        <option value="2014">2014</option>
        <option value="2015">2015</option>
        <option value="2016">2016</option>
        <option value="2017">2017</option>
        <option value="2018">2018</option>
        <option value="2019">2019</option>
        <option value="2020">2020</option>
        
    </select><br /><br />
    <select id="lengthDays">
        <option value="1">1-2 days</option>
        <option value="2">3-5 days</option>
        <option value="3">6-9 days</option>
        <option value="4">10+ days</option>
        <option value="5">Any length</option>
    </select>   
    ?
    <div id="ct_anchor"></div><br /><br /><br /><br />
   
   <input type="submit" value="Search" class="search-button1"/>
</form>

//Demo_form.php
<?php
		  $a = $_POST['destinationID'];
		  $b = $_POST['lengthDays'];
		  $c = $_POST['departYear'];
		  $d = $_POST['departMonth'];
		  echo "durations = " .$d. " " .$a. " " .$b. " " .$c;
 ?>

Hi all.

 

I have a form and a results page, on the results page demo_form.php I cannot seem to echo out the previous pages results, any ideas what I am missing.

 

Code attached

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/286781-form-variables-not-passing-to-next-page/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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