Jump to content

Include Help


fighnight

Recommended Posts

or you can do this...

 

<?php

   // get the page
   $page = $_GET['page'];

   // Now, test the URL query for security
   if ( !is_file ( $_SERVER["DOCUMENT_ROOT"]."/$page.php" ) && $page != "" )
   {
      // File not found!
      header ( "Location: index.php?page=home" );
   }
   // Are you in index?
   elseif ( $page == "" )
   {
      $page = "home";
   }

   // Calling the specific page
   require_once( $_SERVER["DOCUMENT_ROOT"]."/$page.php" );

?>
<a href="index.php?page=page2">Page 2</a>

 

Regards ACE

Link to comment
https://forums.phpfreaks.com/topic/115528-include-help/#findComment-593939
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.