oracle765 Posted March 7, 2014 Share Posted March 7, 2014 <!-- 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 Quote Link to comment https://forums.phpfreaks.com/topic/286781-form-variables-not-passing-to-next-page/ Share on other sites More sharing options...
Skewled Posted March 7, 2014 Share Posted March 7, 2014 echo "durations = " .$d. " " .$a. " " .$b. " " .$c; should be: echo "durations = " .$d. " . " .$a. " . " .$b. " . " .$c. "; It's really late and I apologize if I'm wrong lol! Quote Link to comment https://forums.phpfreaks.com/topic/286781-form-variables-not-passing-to-next-page/#findComment-1471717 Share on other sites More sharing options...
Ch0cu3r Posted March 7, 2014 Share Posted March 7, 2014 You need to name your form fields using name="fieldname" not id="fieldname" Quote Link to comment https://forums.phpfreaks.com/topic/286781-form-variables-not-passing-to-next-page/#findComment-1471744 Share on other sites More sharing options...
Solution oracle765 Posted March 9, 2014 Author Solution Share Posted March 9, 2014 thanks got that working Quote Link to comment https://forums.phpfreaks.com/topic/286781-form-variables-not-passing-to-next-page/#findComment-1471883 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.