making making more pages in one php file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
awiedman
Forum Newbie
Posts: 7
Joined: Wed Sep 24, 2008 6:58 pm

making making more pages in one php file

Post 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?
Darkzaelus
Forum Commoner
Posts: 94
Joined: Tue Sep 09, 2008 7:02 am

Re: making making more pages in one php file

Post 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.
Post Reply