Jump to content

Include question


slpctrl

Recommended Posts

Use $_GET['file'] to retrieve the url variable file. Then use include. Example code:

 

if(isset($_GET['file']))
{
     if(file_exists($_SERVER['DOCUMENT_ROOT'] . $_GET['file']))
     {
           include $_SERVER['DOCUMENT_ROOT'] . $_GET['file'];
     }
}

Link to comment
https://forums.phpfreaks.com/topic/98646-include-question/#findComment-504837
Share on other sites

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.