title: pass javascript variable to another php page
body: <p>I am working on google maps api where i have to calculate the distance from current location to user selected destination.
  The list of destinations are stored in javascript array as:</p>
  
  <pre><code>var details = [
      {
          'title': 'Sobo Central Mall',
          'address': 'PTMM Malvia Marg,Tardeo Road,Mumbai.',
          'lat': '18.975684',
          'lng': '72.811910',
          'open': 'NA',
          'close': 'NA',
          'sex': 'Unisex',
          'place': 'mall'
      }
      //and so on...
  ];
  </code></pre>
  
  <p>which I display in list:</p>
  
  <pre><code>for (i = 0; i &lt; details.length; i++) {
      var place= details[i].title;
      var add= details[i].address;
      document.getElementById('list').innerHTML +='&lt;p&gt;'+ place+ '&lt;br&gt;&lt;div id="address"&gt; ' + add +'&lt;/div&gt;&lt;/p&gt;&lt;br/&gt;&lt;hr/&gt;';
  </code></pre>
  
  <p>here i want to call the another php <code>i.e.direction.php</code> file to which i can pass <code>add</code> variable                 </p>
  
  <pre><code>&lt;a href="direction.php?add="+add+"&gt;dir&lt;/a&gt;
  </code></pre>
  
  <p>And in direction.php:</p>
  
  <pre><code>&lt;?php $add = $_GET['add'];?&gt;
  &lt;script&gt;
  document.getElementById('desti').innerHTML = "&lt;?php echo $add ?&gt;";
  &lt;/script&gt;
  </code></pre>
  
  <p>But <code>$add</code> doesn't have any value in it.
  Can anyone sort out the error?or suggest any different way to pass the js variable to another php file.</p>