title: Appending GET parameters on HREF tag with PHP
body: <p>I'm working on a code like this:</p>
  
  <pre><code>&lt;?php
  $id=$_POST['id'];
  $url_tag = $_POST['url_tag'];
  $url_back = 'https://www.page.example.com/page.php?';
  $query='id='.$id.'&amp;url_tag='.$url_tag;
  $url = $url_back.$query;
  echo 'Look how this url shows up: '.$url;
  echo '&lt;a href='.$url.'&gt;Click here&lt;/a&gt;';
  ?&gt;
  </code></pre>
  
  <p>This is, the page receives two POST parameters. Then prepare a link to <code>https://www.page.example.com/page.php?</code> and I append those two parameters as GET parameters with the ids <code>id</code> and <code>url_tag</code> respectively. </p>
  
  <p>Then I display how the whole link looks like. It shows up correctly, in this case <code>https://www.page.example.com/page.php?id=ID&amp;url_tag=URL_TAG</code>, where ID and URL_TAG are the actual values received as POST parameters.</p>
  
  <p>However, when I click on the '<em>Click here</em>' link, it redirects me to <code>https://www.page.example.com/page.php?</code>, which is the url without any GET parameter.</p>
  
  <p>Why is that happening and how would I solve it? I've tried to feed HREF with urlencode($url) instead, but it redirects me to an address flooded with undesired characters...</p>
  
  <p>Any idea? Thank you!</p>