This tutorial will teach you the basics of using $_GET. It will help you learn how to use $_GET with forms and how to use $_GET with anchors.

Specific requirements of this tutorial:
- Knowledge of HTML and <form>. If I say ‘make a form’ you should know what to do.
(it is assumed that you have all of the requirements specified earlier)
Briefing
Here are the tasks that you have to complete for this tutorial:
- Create a simple form (one input will do). Point the form at another script that will output a link back to the form with the GET value that was submitted. The form should be POST, but it doesn’t really matter.
- Create a more complex set of inputs (6-7 inputs). Mimic the functionality of the first task using this new form. (your script should only output one link.)
- Modify your script for #2. This time the script should only include the GET value in the link if it isn’t empty.
If you have any questions regarding the tasks, please leave a comment.
Run Through/Hints
- If you don’t have a basic idea of how GET works, you should do some searching. This one is pretty easy, just keep in mind that both
$_GETand$_POSTare case sensitive. - Again, make sure that you know how
$_GETworks. This one is just a larger version of the first. - You could do this with a loop or by writing the code out multiple times. Just remember,
empty()is your friend. If you’ve never usedempty(), you can read more about it here.
I’ll post the solution to this problem soon. Good luck. :)
I use $_GET to retrieve the parameters from an HTTP request that the script must handle.
According to the HTTP RFC, the parameter names in an HTTP request are case insensitive. However, the $_GET will not find the ‘name’ parameter when the parameter is actually called ‘Name’.
As the parameter names are case-insensitive, the ‘Name’ parameter should be returned when looking for the ‘name’ parameter.
Is there a cleas solution to accomplish this?
Thanks for you rtime,
Regards,
Wouter