What is a query string?
Imagine you have a URL:
http://www.mywebsite.com/page.php?id=5&name=php
Then the query string is:
?id=5&name=php
In this case, the query consists of two parts: a key
id
with value
5
, and a key
name
with value
php
.
You can access the value of the query string keys using this code:
$id = $_GET['id'];
The above code gets the value of
id
, which is
5
in this case.
Is it important?
Yes, it is, because you can use it to pass data from one page to another. But it's not the only possibility to pass data. If your data contains much characters, use
POST[
^] instead of a query string.
If you want to pass a password,
don't pass it using GET (query strings)! You need to pass it through POST, and SSL is a must! SSL creates an encrypted connection between a web browser and a web server. Without SSL, passing passwords through POST is the same as through GET, because the POST data is also unencrypted. But with SSL, GET data is still unencrypted (but POST data is encryped), that's why you need POST for passwords.