Page 1 of 1

making making more pages in one php file

Posted: Wed Sep 24, 2008 7:00 pm
by awiedman
I noticed many websites that have a index.php file and it shows other pages in that index file for example: (index.php?links show links.php) i was wondering how to do this code any helpers?

Re: making making more pages in one php file

Posted: Thu Sep 25, 2008 7:10 am
by Darkzaelus
The '?' you are seeing says that the 'links show links.php' part is actually a $_GET variable.http://www.w3schools.com/PHP/php_get.asp

The site probably checks, from that variable to see if the file exists, then if it does, either uses:

Code: Select all

 
include(); //OR
require();
 
Probably include, as if you use require and the file isnt there, php gives you a big fat error.


Cheers,

Darkzaelus.