Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

what needs to be added to the end of the web address?

http://localhost/contact-thanks.php--- WHAT DOES IT MEAN BY ?name=randy how i'm gonna know when to put ? and are we defining a variable and values by name=randy

3 Answers

Mike Bronner
Mike Bronner
16,395 Points

Hi Raihan,

This portion of the URL is known as the QueryString. It contains all information that is part of GET. information can be added to the query string using a form which action is get, or manually in a link. In either case, the information in the query string is parsed out in PHP using the $_GET structure.

Below are some references that should help clear things up.:

Let us know if this helps. :)

~Mike

na still confuse about it can we just use it as a variable instead of using it to url I mean what's the point of to use it as a http://localhost/?.......why do I have to add http?

na still confuse about it can we just use it as a variable instead of using it to url I mean what's the point of to use it as a http://localhost/?.......why do I have to add http?

Mike Bronner
Mike Bronner
16,395 Points

The query string is one method of passing information from the fronted (HTML) to the backend (PHP).

oh thnx