title: How to store jQuery function's result and display it on other page
body: <p>I've stuck into this.. I've jquery on a page which runs according to value user put and display result on same page. its working fine but i dont want to display that on that but on next page.<br>
  How to do that?<br>
  I've heard that through ajax call i can give the result to php and can store there but i dont know how to do that or if there is easy way then that?</p>
  
  <pre><code>&lt;form method="post"&gt;
      &lt;div class="form-group row"&gt;
          &lt;label for="age" class="col-sm-7"&gt;&amp;bull; What is the age of the oldest person applying? &lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;select type="age" class="form-control form-control-sm" id="age" name="age"&gt;
                  &lt;option value="" selected="" disabled=""&gt;Please Select&lt;/option&gt;
                  &lt;option value="Under 35"&gt;Under 35&lt;/option&gt;
                  &lt;option value="&gt;35 - 44"&gt;35 - 44&lt;/option&gt;
                  &lt;option value="&gt;45 - 54"&gt;45 - 54&lt;/option&gt;
                  &lt;option value="&gt;55 - 59"&gt;55 - 59&lt;/option&gt;
                  &lt;option value="&gt;60 - 64"&gt;60 - 64&lt;/option&gt;
                  &lt;option value="&gt;65 - 69"&gt;65 - 69&lt;/option&gt;
                  &lt;option value="&gt;70 - 74"&gt;70 - 74&lt;/option&gt;
                  &lt;option value="&gt;75 - 79"&gt;75 - 79&lt;/option&gt;
                  &lt;option value="80 +"&gt;80 +&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group row"&gt;
          &lt;label for="dependant" class="col-sm-7"&gt;&amp;bull; How many additional dependants will be covered?&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;select type="person" class="form-control form-control-sm" id="person" name="person"&gt;
                  &lt;option value="0" selected disabled&gt;Please Select&lt;/option&gt;
                  &lt;option value="00"&gt;00&lt;/option&gt;
                  &lt;option value="01"&gt;01&lt;/option&gt;
                  &lt;option value="02"&gt;02&lt;/option&gt;
                  &lt;option value="03"&gt;03&lt;/option&gt;
                  &lt;option value="04"&gt;04&lt;/option&gt;
                  &lt;option value="05"&gt;05&lt;/option&gt;
                  &lt;option value="06"&gt;06&lt;/option&gt;
                  &lt;option value="07"&gt;07&lt;/option&gt;
                  &lt;option value="08"&gt;08&lt;/option&gt;
                  &lt;option value="09"&gt;09&lt;/option&gt;
                  &lt;option value="10"&gt;10&lt;/option&gt;
                  &lt;option value="11"&gt;11&lt;/option&gt;
                  &lt;option value="12"&gt;12&lt;/option&gt;
                  &lt;option value="13"&gt;13&lt;/option&gt;
                  &lt;option value="14"&gt;14&lt;/option&gt;
                  &lt;option value="15"&gt;15&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;input type="button" id="next" name="next" value="Next"&gt;
  &lt;/form&gt;
  
  &lt;div class="alli"&gt; $0&lt;/div&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
      $("#next").click(function update_pricing() {
  
          //pricing data for pricing table
          var pricing_data = {
  
              single: {
                  "0"       : [0, 0, 0],
                  "Under 35": [46.75, 124.25, 152.25],
                  "&gt;35 - 44": [51.75, 138.25, 168.50],
                  "&gt;45 - 54": [59.00, 152.25, 195.50],
                  "&gt;55 - 59": [63.25, 160.00, 209.00],
                  "&gt;60 - 64": [71.00, 170.50, 220.50],
                  "&gt;65 - 69": [58.50, 144.25, 187.00],
                  "&gt;70 - 74": [71.25, 187.50, 229.00],
                  "&gt;75 - 79": [77.50, 225.00, 303.75],
                  "80 +"    : [97.25, 275.75, 366.00]
              },
              couple: {
                  "0"       : [0, 0, 0],
                  "Under 35": [88.75, 236.75, 288.50],
                  "&gt;35 - 44": [99.00, 262.75, 320.75],
                  "&gt;45 - 54": [112.00, 288.50, 371.25],
                  "&gt;55 - 59": [120.25, 303.75, 397.50],
                  "&gt;60 - 64": [134.75, 323.75, 419.25],
                  "&gt;65 - 69": [111.25, 275.25, 355.50],
                  "&gt;70 - 74": [135.25, 356.50, 435.25],
                  "&gt;75 - 79": [147.75, 427.75, 577.00],
                  "80 +"    : [184.50, 523.50, 696.00]
              },
              family: {
                  "0"       : [0, 0, 0],
                  "Under 35": [116.50, 310.50, 379.00],
                  "&gt;35 - 44": [129.50, 345.25, 421.00],
                  "&gt;45 - 54": [147.25, 379.00, 488.25],
                  "&gt;55 - 59": [157.50, 399.00, 522.25],
                  "&gt;60 - 64": [177.00, 425.25, 551.50],
                  "&gt;65 - 69": [146.25, 361.25, 467.25],
                  "&gt;70 - 74": [177.50, 468.75, 572.50],
                  "&gt;75 - 79": [194.00, 562.25, 759.00],
                  "80 +"    : [242.50, 688.50, 914.75]
              }
          }
  
          var age_order = {
              "0"       : 0,
              "Under 35": 1,
              "&gt;35 - 44": 2,
              "&gt;45 - 54": 3,
              "&gt;55 - 59": 4,
              "&gt;60 - 64": 5,
              "&gt;65 - 69": 6,
              "&gt;70 - 74": 7,
              "&gt;75 - 79": 8,
              "80 +"    : 9
          }
  
          var age_fields = $('select[id^="dep_age_"], #age');
  
          var family_size = parseInt($('#person').val());
  
          var max_age = "0";
  
          function do_update() {
  
              var pricing_set;
  
              //grab appropriate pricing set from pricing data
              if (family_size == 0) {
                  pricing_set = pricing_data.single[max_age];
              } else if (family_size === 1) {
                  pricing_set = pricing_data.couple[max_age];
              } else if (family_size &gt; 1) {
                  pricing_set = pricing_data.family[max_age];
              }
  
              var price_carrier = $('.alli'); //put price values here in pricing tables
  
              //if appropriate pricing set is grabbed (not true when either one of age or family size not selected)
              if (pricing_set) {
  
                  //put price values in all pricing tables
                  price_carrier.each(function (i, el) {
  
                      //if family members are more than 6, increase prices by 30%
                      if (family_size &gt; 6) {
                          $(el).text('$' + (pricing_set[i] + pricing_set[i] * 0.3).toFixed(2));
                      } else {
                          $(el).text('$' + pricing_set[i].toFixed(2));
                      }
                  });
              }
          };
  
          age_fields.each(function () {
              if (age_order[$(this).val()] &gt; age_order[max_age]) {
                  max_age = $(this).val();
              }
          });
          do_update();
      })
  &lt;/script&gt;
  </code></pre>