Welcome Guest | RSS Мой сайт -->
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
[Totorial] PHP SusbPages!
AlteranDate: Tuesday, 06.04.2010, 19:49 | Message # 1
Lieutenant
Group: Administrators
Messages: 42
Reputation: 0
Status: Offline
I will tel you how to made "PHP SubPages".
First You need nade "pages" map in
www map if it is Appserv 2.5.8
htdocs map if it is XAMPP

Now you need open index.php were you will see news.

Code
<?php
if ((!isset($_GET['gst])) && (!isset($_POST['gst'])))        
         $gst  = 'index';        
        else        
         $gst  = ((isset($_POST['gst'])) ? $_POST['gst'] : $_GET['gst']);

        $gst  = strtolower(trim(preg_replace('/[^0-9a-z]/i','',$gst)));
               
        switch ($gst)
        {
               
         // ===========================================================================================
         // Normal-Functions
         // ===========================================================================================
                
         case '<your page>'   :

                

          require_once('pages/inc.'.$gst.'.php');
          break;

         default    :

           header('Location: /404.php ');

        }
?>

then made in map "pages" the files "inc.<your page>.php"

Your web link code is:

Code
<a href="/?gst=<your page>"><your page></a>

Thats all Your sub pages is ready.


 
  • Page 1 of 1
  • 1
Search:


Copyright MyCorp © 2025