title: How to get parent url
body: <p>For instance my current url is</p>
  
  <pre><code>http://www.sample.com/check/?code=1
  </code></pre>
  
  <p>Web page under this url contains a link </p>
  
  <pre><code>&lt;a href="http://www.sample.com/check/?code=2"&gt;Code2&lt;/a&gt;
  </code></pre>
  
  <p>When this link is clicked it takes to  <code>http://www.sample.com/check/?code=2</code></p>
  
  <p><strong>Question:</strong>
  Under the web page displayed under <code>http://www.sample.com/check/?code=2</code> i have to fetch the url from which this page had came from. How to do this. </p>
  
  <p>Thanks in advance...</p>