title: Passing data in URL vs submitting via form using GET
body: <p>I have written a small php (test.php) that reads and displays the data passed to it.</p>
  
  <p><code>&lt;?php $name = $_GET['name'];
  echo $name;?&gt;</code></p>
  
  <p>When I execute the following URL
  <code>http://localhost/test.php?name=Géo</code></p>
  
  <p>The text that gets displayed is: G�o</p>
  
  <p>However, when I submit "Géo" from another webpage:</p>
  
  <p><code>&lt;form method="get" action="test.php"&gt;
  &lt;input type="test" name="name"&gt;
  &lt;input type="Submit"&gt;
  &lt;/form&gt;</code></p>
  
  <p>the URL changes to <code>http://localhost/test.php?name=G%C3%A9o</code></p>
  
  <p>and now the correct text is displayed:Géo</p>
  
  <p>In the first scenario, only when I add utf8_encode( $_GET['name']),  the correct text (Géo) gets displayed.</p>
  
  <p>My question:
  Is it possible to know how the data was passed, submitting via a form or directly from the URL. If not then what changes should I make to the webpage so that both the scenarios are handled correctly i.e. display Géo in both the cases.</p>
  
  <p>Thanks for your help.</p>