Jump to content
xisto Community
Sign in to follow this  

Php Navigation Made by me

Recommended Posts

Step 1: Make a file, in this case we have named it navigation.php

Step 2: Enter the code below. I have added in comments for some help, but still please read the part below to find out more about this script and what you should change in it to integrate it to your site.


<?php$name = "Simple PHP Navigation"; //The name of the page$site = "<center><b><u>$name</b></u></center> //A Little Title For Each Page<br />";$filename = "navigation.php"; //Change this to whatever your filename isif ($_GET['page'] == 'page1') { //This is page 1 dataecho "$siteThis is page 1<br /><br /><a href="$filename">Go Back!</a>";}elseif ($_GET['page'] == 'page2') { //This is page 2 dataecho "$siteThis is page 2<br /><br /><a href="$filename">Go Back!</a>";}elseif ($_GET['page'] == 'page3') { //This is page 3 dataecho "$siteThis is page 3<br /><br /><a href="$filename">Go Back!</a>";}else {//below is the navigation and home pageecho "<center><title>$name</title>Welcome to $name, this is a simple PHP Navigation for everyone to use created by Lewis Brand.<br /><b><u>Navigation</b></u><br /><a href="$filename?page=page1">page1</a><br /><a href="$filename?page=page2">page2</a><br /><a href="$filename?page=page3">page3</a><br />";}?>


Step 3: Edit some parts of it, you might want to change the $name variable to your site name. Change $filename to the name of the file you have put this code in.


Step 4: To edit the pages where it has


}elseif ($_GET

 == 'pagename') {

Just edit the pagename text to the name of the page you want.

Step 5: To edit the navigation, this is placed at the bottom of the script which is the home page.


<a href="$filename?page=pagename">pagename</a><br />

Just edit the parts which say pagename to what you want your page name to be.


That's all.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.