Creating Navigation
Create a navigation script for a webpage.
Category: Coding
Views: 5949

Creating Navigation Welcome to the tutorial, today you will learn how to create page=link link's

Code:
class navi{ //the class
function page($page){ //name the function
if(empty($page)){ //if the link is empty
include 'index.php'; //include your default page
}
elseif(file_exists($page.'.php')){ //else if the file exists
include $page.'.php'; //include it
}
else{ //the file does not exist
echo 'That file does not exist!';
}
}
}
$nav = new navi; //new navi
$nav->page($_GET['page']); //get the page and write the function
?>

Here is the navigation script, I hope it's easy enough to read and understand with the comments.

If you would like more help with this tutorial please register and visit the forum.

About Michael

Michael Dunlop Michael Dunlop personal statement

“But I am already older than 21”, I hear you cry. Don’t worry, despite the name, the information and advice is more geared towards retiring prior to having a fake hip installed.

Website Sponsors
Get Retire at 21's FREE Secrets

Get Retire at 21's FREE Secrets

Find out how I'm going to Retire VERY Early Subscribe for my Free Secrets Privacy Guaranteed. 100% Spam free.

Join The Forum
Recommended Websites
Credit card processing made easy! Same day approvals, no application fee, free setup, 24/7 customer support, free equipment, and more. Cardaccept is the clear choice.
Create stuning Flash websites at Wix.com, Seo Friendly, Drag & Drop builder.
How do you go from making $25,000.00 a year to $25,000.00 a month? Auto-Pilot residual system - step by step formula for creating a truly automated income on-line.
Rob Benwell, a UK millionaire bloggers reveals in this step by step blueprint how he makes as much as $90,480 a month from just a few hours work.
 
Advertise Here
Feature Interviews
Ryan Deiss is a self-made Internet ... Read more
Interview with Yaro Starak of Entrepreneurs-Journey.com is ... Read more
Darren Rowse is perhaps the most famous ... Read more
This is an awesome interview. I ... Read more
Recommended Resources