Query Strings

Warning: This article/tutorial is more the 45 days old. As such the information contained within could be, by now, out of date. Please read all information to make sure that this article/tutorial will work with your current version of the Operating System

What is a query string?
A query string is the part of a URL that sends variable values to the script.

What’s the syntax?
Well, after the page name, you put a question mark (?). This separates the file name from the variables. Between each variable you set, put an ampersand (&).

An example?
The query string is bold:

Show me how to incorporate them into the page!
You use them as $_GET variables. The following code will be page.php, and will be accessed with the URL of http://www.phpmac.com/page.php?name=Jake&colour;=red.

Using Query Strings

This would output The favourite colour of Mr. Jake is red

Leave a comment

Your email address will not be published. Required fields are marked *