Welcome Guest ( Log In | Register )




                Web Hosting Guide

 
Reply to this topicNew Topic
Php Navigation, Made by me
Lewisthemusician
post Sep 25 2007, 06:52 PM
Post #1


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 52
Joined: 5-January 07
Member No.: 19,160


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.

CODE
<?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 is


if ($_GET['page'] == 'page1') { //This is page 1 data
echo "
$site
This is page 1
<br />
<br />
<a href="$filename">Go Back!</a>";

}elseif ($_GET['page'] == 'page2') { //This is page 2 data
echo "
$site
This is page 2
<br />
<br />
<a href="$filename">Go Back!</a>";

}elseif ($_GET['page'] == 'page3') { //This is page 3 data
echo "
$site
This is page 3
<br />
<br />
<a href="$filename">Go Back!</a>";

}else {
//below is the navigation and home page
echo "
<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

CODE
}elseif ($_GET[page] == '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.

CODE
<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.
Enjoy!
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts 1 BHerath 2,693 22nd July 2009 - 09:44 AM
Last post by: iG-Ryan
No New Posts   2 Leveecius 533 7th December 2008 - 07:08 PM
Last post by: Leveecius
No New Posts   7 mischievous 3,103 16th May 2008 - 01:34 AM
Last post by: TavoxPeru
No New Posts 4 dhanesh 1,097 14th May 2007 - 02:09 PM
Last post by: viettre


Web Hosting Powered by ComputingHost.com.
HONESTY ROCKS! truth rules.
Creative Commons License