title: Use form input to build url with php.
body: <p>I'm trying to create a form where the user can input their id (username) and it will be appended as a variable in a url that is used in my php script. This is what I have.</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submit']))
  {
      $id = $_POST['id'];
      echo 'http://example.com/default.asp?action=data&amp;id=$id';
  }
  ?&gt;
  &lt;form method="post" action="&lt;? echo $_SERVER['PHP_SELF']; ?&gt;"&gt;
     &lt;input type="text" name="id"&gt;&lt;br&gt;
     &lt;input type="submit" name="submit" value="Submit Form"&gt;&lt;br&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>It collects the user's id properly, and if i just echo $id, it outputs the proper value, but when I try to echo the url, it just outputs $id instead of the actual value of the $id variable. What am I doing wrong?</p>