PDA

View Full Version : Include PHP within HTML page?



cyberious
01-05-2004, 10:56 PM
I have managed to include a php script into a .php page, but now I can't include the html header I usually SSI into the rest of my site....

Let me rephrase that... I have a basic HTML driven site. I need one part of the site to be in php (a gallery). So, taking a normal HTML page, changing the extension to .php, and Including the PHP file into that part of the page has disabled the SSI to the "header.html" as well as the main CSS, the tables, etc.

I wanted to embed the PHP script into the main content table, without ruining the layout of the page.

Example of the main layout: http://www.sundowntile.com/NEWSITE/index.shtml
*This is not done at all, just thrown together to see what I have to work with.

File including the PHP script: http://www.sundowntile.com/Portfolio/portfolio.php
*I originally had this page in a different directory, but realized it would not work at all from outside the php script.

Actual PHP Script I'm trying to include: http://www.sundowntile.com/Portfolio/spid.php

Now here's the clincher: Since I can't click on the "Category" link to get back to "portfolio.php" again (it just returns you to the actual "spid.php" page instead) I was thinking about calling just a category - $cat = "baths" - for instance. But I don't know how! That would solve the problem with the Category link but not the SSI to the header. UGH!

Each page needs to call: an External JavaScript file; SSI to the header and footer. One section needs to be able to show the gallery which is a .php script.

Anyone have a better idea? I don't know how to write PHP (yet!) so I can't customize the php script to display my page the way I want it to look.....

What would you do in this situation?

cyanide
01-05-2004, 11:16 PM
Hi cyberious,

Well the syntax to do a php include is:
<? include("header.php"); ?>
Just replace the red highlight with the path to your header file.


Now here's the clincher: Since I can't click on the "Category" link to get back to "portfolio.php" again
ONe thing you can try is making a copy of your header file, call it header_gallery.php and then hard code your link to portfolio.php

I didn't quite understand a couple of things you were asking; a bit bleary-eyed at the moment.
Let me know if any of this helps, though
Please post back

Cheers