Jump to content

Navigation system help


supermerc

Recommended Posts

Hey, for the first time im using php navigation system for my site, so I dont really know to make it work, but I got this code from a tutorial;

 

           <?Php 

    // Define our array of allowed $_GET values

        $pass = array('test','okay','please');

            

    // If the page is allowed, include it:

        if (in_array($_GET['page'], $pass)) {

            include ($_GET['page'] . '.php'); 

        } 

        

    // This will load the default page:

        elseif (!isset($_GET['page'])) {

            include ('home.php'); 

        }



    // If the page is not allowed, send them to an error page:

        else {

                // This send the 404 header

                    header("HTTP/1.0 404 Not Found");

                // This includes the error page

                    include ($_SERVER['DOCUMENT_ROOT'] . '/error.php');

        }

?>

 

First ill explain how my site is set up maybe that will help you help me, I have a page, that has a table with 3 columns, in the left I have an include statement all my left menues, the center is my main content, and right is an include statement for my right menues. So i have that code in my center box for my content. In the left page that I inlcude, i have my links;

 

<a href="index.php?id=test">test<br />
                            </a><a href="index.php?id=okay">okay</a><br />
                            <a href="index.php?id=please">please</a></td>

 

When I load my index.php it sucessfully brings me to home.php so i guess the

 

        elseif (!isset($_GET['page'])) {

            include ('home.php'); 

        }

is working.

But when I click on the links it doesnt do anything, it like loads home.php again.

 

Please help me, thanks a lot!

Link to comment
https://forums.phpfreaks.com/topic/90613-navigation-system-help/
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.