Jump to content

PHP script to include webpages with in a page


mikemxc

Recommended Posts

Im sorry to ask im sure such a silly question. But, I can't for the life of me find the simple script to include a page with in one php page.

 

where you would use te url like http://anypage.com/index.php?id=signup

 

then the script would just include signup.php within index.php.

 

 

help please..

 

thanks

for example you can create a list of allowed pages

 

$whitelist = array("signup","about","products"); //only allow pages from this list
if(in_array($_GET['id'],$whitelist)) {  //check if page to be included is in the list
  include($_GET['id'].".php"); 
} else {
  die("No such page!");
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.