Log in

View Full Version : What kind of PHP page is this



DigiSoft
10-13-2007, 04:16 PM
I am new to php and I want to make dynamic php page that would look like this:

http://www.sdfsdfsdfsdfsdf.com/index.php?id=1

What means index.php?id=1 ????
Is this link that loads data from database or from PHP pages.
How can I make links that look like this index.php?id=1

Thanks.

Twey
10-13-2007, 04:51 PM
In your example, the 1 is $_GET['id']. However, I prefer the http://www.example.com/page.php/1 form, where the 1 is obtained by preg_replace('\\D', '', $_SERVER['PATH_INFO']) + 0.

DigiSoft
10-13-2007, 05:02 PM
Thanks for the info but can you give me very sample example. Like we all know the easiest way for learning is from examples.
So does this kind of link loads the data from database or it takes php page.
I am learning now php but don't understand this cind of browsing. Thanks.

What does this link loads index.php?id=1 ???

Twey
10-13-2007, 05:09 PM
So does this kind of link loads the data from database or it takes php page.It's impossible to tell. Some data is passed to the PHP page in the URL (in this case, an ID of some sort presumably), but what the page then does with that data is a mystery.

DigiSoft
10-13-2007, 05:14 PM
Aha yes ok I understand it thanks. I see what is the point.
Thanks again.