I have written a small php (test.php) that reads and displays the data passed to it.
<?php $name = $_GET['name'];
echo $name;?>
When I execute the following URL
http://localhost/test.php?name=Géo
The text that gets displayed is: G�o
However, when I submit "Géo" from another webpage:
<form method="get" action="test.php">
<input type="test" name="name">
<input type="Submit">
</form>
the URL changes to http://localhost/test.php?name=G%C3%A9o
and now the correct text is displayed:Géo
In the first scenario, only when I add utf8_encode( $_GET['name']), the correct text (Géo) gets displayed.
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.
Thanks for your help.