Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 14-12-2007, 09:29 PM   #1 (permalink)
Be CoOl rAp RuLeZ !!!
 
krates's Avatar
 
Join Date: Feb 2007
Posts: 1,968
Wink Php simple navigation same as vb

Html pages are boring. Everyone is using php navigations now, for example ?id=news etc., well its not all that complicated and since you are reading this I assume you would like to learn how to do it!


Note:

Your server must have php installed for this to work and your extensions should end in .php.
And on to the tutorial:
This is the basic code I use, you can copy it and put it on your page!


Note
This code would go in your main content area.


<?php
switch($id) {
default:
include(’news.php’);
break;
case ‘about’ :
include(’about.html’);
break;
}
?>


Thats it, however i will explain it in a bit more depth..


default:
include(’news.php’);
break;


This is the main page you want to open when you load your website for most people its news and updates etc. This can be php or html or whatever.


case ‘about’ :
include(’about.html’);
break;


This is the page you want to include next such as an about page etc. Keep adding the pages so you got all you need. Your code will look like something below:


<?php
switch($id) {
default:
include(’news.php’);
break;
case ‘about’ :
include(’about.html’);
break;
case ‘tutorials’ :
include(’tutorials.php’);
break;
case ‘downloads’ :
include(’downloads.html’);
break;
case ‘templates’ :
include(’temps.html’);
break;
case ‘comming’ :
include(’soon.html’);
break;
}
?>


Now if you are not completely lost yet this is what you do to link your pages, Change your links from



<a href=”about.html” mce_href=”about.html”>About</a> to <a href=”?id=about” mce_href=”?id=about”>About</a>



if you like this please comment on my blog post
__________________
iPhone 3G 16GB + Samsung I450 + Sennheiser CXL 400 + PSP Phat + Samsung NC10

Previous phones: N73ME , W810I , Asus P320
krates is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 14-12-2007, 11:00 PM   #2 (permalink)
Wise Old Owl
 
The Unknown's Avatar
 
Join Date: Nov 2006
Location: Pune, Maharashtra, India
Posts: 1,728
Default Re: Php simple navigation same as vb

Dude, this every small Web Designer knows. huh. Anyone developing in PHP knows this.
__________________
KDE on ArchLinux
PHP, MySQL, PostgreSQL, Linux, Apache; Message me to hire (freelancing only)
Explore Technology @ http://www.itech7.com
Cheap and Reliable VPS Hosting @ http://j.mp/arHk5e
The Unknown is offline  
Old 14-12-2007, 11:27 PM   #3 (permalink)
Be CoOl rAp RuLeZ !!!
 
krates's Avatar
 
Join Date: Feb 2007
Posts: 1,968
Default Re: Php simple navigation same as vb

^^^^ cool but still noobs don't
__________________
iPhone 3G 16GB + Samsung I450 + Sennheiser CXL 400 + PSP Phat + Samsung NC10

Previous phones: N73ME , W810I , Asus P320
krates is offline  
Old 15-12-2007, 07:33 AM   #4 (permalink)
Wise Old Owl
 
The Unknown's Avatar
 
Join Date: Nov 2006
Location: Pune, Maharashtra, India
Posts: 1,728
Default Re: Php simple navigation same as vb

Quote:
Originally Posted by kushagra_krates@yahoo.com
^^^^ cool but still noobs don't
rite.
__________________
KDE on ArchLinux
PHP, MySQL, PostgreSQL, Linux, Apache; Message me to hire (freelancing only)
Explore Technology @ http://www.itech7.com
Cheap and Reliable VPS Hosting @ http://j.mp/arHk5e
The Unknown is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me in Navigation Menu satyamy QnA (read only) 3 26-05-2007 12:56 AM
Bring VIM-like navigation to Firefox eddie Technology News 12 07-05-2007 11:33 AM
new solution for off-board navigation coolbzl QnA (read only) 3 05-06-2006 04:27 PM
problems in broadband navigation using Sify techkid Broadband and DTH 5 15-02-2005 08:30 AM


All times are GMT +5.5. The time now is 10:33 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2