Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
One Navigation Menu For All Webpages
Old 03-18-2008, 04:16 PM One Navigation Menu For All Webpages
Novice Talker

Posts: 10
Trades: 0
I've tried search the forums and the net but I can't seem to find a specific answer that my brain will understand :P

I just want one menu (mine is currently created with just CSS and XHTML) to show up on all webpages. So, if I were to change something on that menu, I won't have to go to each page and change it. Get what I'm saying?

I think it's to do with PHP, so that's why I'm posting here. Something to do with <include navigation.php> or something...?

Thanks in advance.
ill_phil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-18-2008, 04:24 PM Re: One Navigation Menu For All Webpages
Average Talker

Posts: 20
Trades: 0
Hey, all you have to do, is create your xhtml and css navigation and save it as navigation or something. Then simply go ahead and put the code below into the place you wish for the navigation to be.

Code:
<?php include('navigation.php'); ?>
That simple, there ya go .
UnfixedCODERJ is offline
Reply With Quote
View Public Profile
 
Old 03-18-2008, 04:24 PM Re: One Navigation Menu For All Webpages
Defies a Status

Posts: 3,420
Trades: 0
To do this, you will be using PHP.

The pages that have the file in will also have to be PHP files.

It's quite simple - create a file called menu.php or navigation.php or whatever, and then in each page that you want the navigation bar in, type:

PHP Code:
<?php include('navigation.php'); ?>
Of course, if your menu was stored in a PHP file called menu.php, you'd type include('menu.php') etc.

Dan

EDIT: the guy above must have posted seconds before me - he's basically written the same as me.
CSS4Life is offline
Reply With Quote
View Public Profile
 
Old 03-18-2008, 04:33 PM Re: One Navigation Menu For All Webpages
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
lol, yeah, even the same name of the file
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 03-18-2008, 10:57 PM Re: One Navigation Menu For All Webpages
Novice Talker

Posts: 10
Trades: 0
Thanks for the reply guys, but I'm still having problems.

I've created a file called index.html and another called index.php for the sake of it. Also, another file called header.php. In that header.php file is just some text saying "Hello".

In both my index.html and index.php file, I've typed

PHP Code:
<?php include('header.php') ;?>
But it still doesn't work. I'm using Adobe Dreamweaver CS3, and instead of "Hello" showing up, a little PHP shield icon shows up. What gives?
ill_phil is offline
Reply With Quote
View Public Profile
 
Old 03-18-2008, 11:58 PM Re: One Navigation Menu For All Webpages
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
PHP is a server side language therefore the output is generated by going through a web server. Upload to your web host or use xampp for development on you desktop.
joder is offline
Reply With Quote
View Public Profile
 
Old 03-20-2008, 04:52 PM Re: One Navigation Menu For All Webpages
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
Yeah, WYSIWYG editors will not display this kind of thing, like joder says because its a server side code.
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to One Navigation Menu For All Webpages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25847 seconds with 12 queries