View Full Version : PHP General php page question
oli99via
October 29th, 2009, 11:28 PM
I am new to php. I want to know why php page has extensions like "?", "ID=X"? For example: "www.abc.com/page_result.php?memberproductID=10&product=3 (http://www.abc.com/page_result.php?memberproductID=10&product=3)"
Is it some kind of database link?
Many thanks in advance!
birdwing
October 29th, 2009, 11:50 PM
its called a GET variable, for instance.
http://www.yourwebsite.com/form2.php?n=10
The first page "form1.php" has a link to the above address
What that means is that in "form2.php" the value of 10 is equivalent to the global variable:
$_GET['n'];
Get it?
oli99via
October 30th, 2009, 02:26 AM
Hmm.. what's global variable? How do you come up with the value?
birdwing
October 30th, 2009, 12:05 PM
I would start looking up the different types of variables available to you in PHP This is a good start (http://tinyurl.com/yjsfqbw)
As for as the value lets use Kirupa's forums as an example shall we.
http://www.kirupa.com/forum/member.php?u=91715 is the link to your user page
http://www.kirupa.com/forum/member.php?u=130552 is the link to MY user page
notice the similarity? the only difference is the variable $_GET['u'] which is our user number in the database.
The user page takes this Get variable and uses it against the database to retrieve the information from the user with that user number.
This allows you to make 1 webpage that will look to the user like multiple webpages. In other words Kirupa only had to build 1 user page. But that page changes depending on which user we are getting info from.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.