PHP Tutorial – $_GET Function
The PHP built-in $_GET function is used to collect values in a form (as name says, you do this with the method=”get”) You should remember that the information sent from a form with the GET method is visible to everyone, because the result is displayed in the address bar.
The $_GET function limits the number of characters to be send (max. 100 characters.)
An example:
<html>
<body>
<form action="test.php" method="get">
Your name: <input type="text" name="yourname" />
<input type="submit" />
</form>
</body>
</html>
When the user clicks on submit, an URL is sent to the server that will look something like this:
http://www.codingunit.com/test.php?yourname=John
Warning: as you can see you can read the input text. That’s why you should be careful with $_GET function. For example you should never use a GET method in a login form.
But it can also be useful to see what the content is of the variable. Because the variables are displayed in the URL, you can for example bookmark the page. Just an example, but you should be careful with the get method.
Sir i am trying to retrieve data from mysql table using php get method my database name is sweet and my table name is person so sir i am not able to get the data from my mysql database pls can you assist me