Current location: Hot Scripts Forums » Programming Languages » PHP » PHP navigation


PHP navigation

Reply
  #1 (permalink)  
Old 06-22-04, 12:21 AM
HuntHerr HuntHerr is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
PHP navigation

Hi,
I'm new to PHP and I have a question on site navigation. I have one table, with all the navigation links in different cells. How do i get it to display the link in a different cell in a different table somewhere else on the page? Before, i was using <iframes> and if I had to fix one thing on the side, i'd have to fix every page. Any ideas, I know its easy, I'm just a little lost.
Thanks
Reply With Quote
  #2 (permalink)  
Old 06-22-04, 11:34 PM
rottedham rottedham is offline
Newbie Coder
 
Join Date: May 2004
Location: Katy, TX
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
you could always use include. to do this, simply put the content you want to display in a seperate file.. for instance, nav.php and in the page you want it displayed on, use this code:
PHP Code:

<?php include("nav.php");?>

then all you will need to do to update the navigation bar or whatever part you need to, just update the one file and it shows on every page you include it on. this also works very well with headers and footers. hope this helps!
Reply With Quote
  #3 (permalink)  
Old 06-23-04, 01:00 AM
HuntHerr HuntHerr is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I was told a way by using switch statements, something like this:

<?php
switch($Page)
{
case "portfolio":
$Title='Portfolio';
$PageInclude='Portfolio'.php';
continue;

case "photogallery":
$Title='Photo Gallery';
$PageInclude=photogallery.php';
continue;

case "services":
$Title='Services';
$PageInclude=services.php';
continue;

case "filearchive":
$Title='File Archive';
$PageInclude=filearchive.php';
continue;

case "contact":
$Title='Contact';
$PageInclude=contact.php';
continue;

case "home":
$Title='Welcome';
$PageInclude=home.php';
continue;

case "admin":
$Title='Website Administration';
$PageInclude=admin.php';
continue;

default:
$Title='Welcome';
$PageInclude=welcome.php';
continue;
}
?>

And then in the table cell where it is displayed:

<?php include($PageInclude); ?>

but, i dont get the menu with the links =\ Sorry if this seems really stupid, but i just cant get it. Thanks
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
PHP integrated with ASP Mikeirv PHP 7 05-25-04 05:00 AM
PHP Site Navigation mixermanic PHP 12 03-02-04 06:53 AM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 12:31 AM
How to convert php generated pages to SE friendly HTML or PHP(SE friendly) -CLASS 101 crippled PHP 1 11-16-03 06:37 AM


All times are GMT -5. The time now is 05:03 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.