PDA

View Full Version : One page into another?


Cassavus
11-20-2005, 11:14 AM
ok, does anyone know how to pull one page into another? say i have index.php and i want to pull nav.htm into the index page. how do i do that? would that involve SSI? because when i do it now, it messes up the layout of the page. heck, if you all don't know, no worries. i have a backup idea.

Project-Buckfast
11-20-2005, 11:40 AM
Try something like this. You can put that code in the area you would like the page to included

<?php include('pagename.php'); ?>

I think you'll need to change the extension of the page you want to include to .php otherwise it may not work

Cassavus
11-20-2005, 10:51 PM
yea i think so too. because i tried earlier with a .htm extension and it just gave an error. but how do i make a page that is otherwise just regular xhtml, php? isn't there something i need to do to at least the beginning of the code that tells that it is going to be php?

Project-Buckfast
11-21-2005, 05:49 AM
It should work as long as the extension of your pages are .php

I designed my site as html and changed the extensions to .php

For the navigation of my site I use the code

<?php include(navigation.txt); ?>

It's pulls the navigation.txt file which (obviously) has the links for my site. Handy because it allows you to add, change and remove links sitewide with a simple edit of the .txt file

Maybe it won't work lol. But it's worth a shot :)

Lord_of_the_Dense
11-21-2005, 10:31 AM
Why is your first post here stretching the post window, PB?

Cassavus
11-21-2005, 11:04 AM
It should work as long as the extension of your pages are .php

I designed my site as html and changed the extensions to .php

For the navigation of my site I use the code

<?php include(navigation.txt); ?>

It's pulls the navigation.txt file which (obviously) has the links for my site. Handy because it allows you to add, change and remove links sitewide with a simple edit of the .txt file

Maybe it won't work lol. But it's worth a shot :)


I see what you're saying PB. I'll work with it later today. Thanks man! Yea, I did txt files on one of my old sites. But if I remember correctly I used a SSI code to pull them.

Cassavus
11-21-2005, 11:05 AM
Why is your first post here stretching the post window, PB?

Hmmm, not sure what you're seeing LOTD. Looks alright to me :)

Cassavus
11-22-2005, 01:07 AM
got it working PB! i seemed to not have had the path correct the last time I did it. then i noticed i didn't have the ' ' marks in either. works now though! thanks PB!

Project-Buckfast
11-22-2005, 05:00 AM
No probs Cass

Project-Buckfast
11-22-2005, 05:03 AM
It's the [code] tags. I've seen it happen here a few times. Dunno why, the code boxes are small :shrug:

Why is your first post here stretching the post window, PB?