Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

repeated index 1

Status
Not open for further replies.

faxof

Programmer
Dec 5, 2001
272
GB
evenin' all

if i have an index (basic navigation list of links managed by css) that i want repeated on every page in my site. is there a way (possibly using php) that i can have one source file that contains all the links, and have all my detail fles pick up and display the links that are in the source file.

 
Yes, you can use the "require" keyword to include other pages in a PHP page. For more help, I'd suggest asking in the PHP forum (forum434).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
the include(); function would be more suitable (I think)

Create an HTML fragment, literally just the html that creates the navigation (no head, body etc)...
Then simply put
Code:
<?
include("myNav.html");
?>

Where you want the nav to appear and it will be included in the HTML that is sent to the browser when a page is requested.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Yeah that looks to be a better solution


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
cheers guys, but i'm a bit of a newbie

all i see in the browser is include(filename)

i renamed my html file to php but that didnt work (i didnt think it would)

im not entirely sure how to get it working
 
Did you use the [attn]<?[/attn] tags like FoamCow suggested? Also, you should really ask this in the PHP forum if this is going to start getting into PHP syntax.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
yes good point, but i aldready checked that.

it does work now, the problem was the tags, the fisrt one <? needed to be <?php

still, a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top