| 7:21 pm on Dec 20, 2002 (gmt 0)|
Welcome to WebmasterWorld [webmasterworld.com] princess
You can use the php include function [php.net]
it would look something like this if you wanted to include a file in the same dir as the page calling it.
| 7:46 pm on Dec 20, 2002 (gmt 0)|
So I put this into all my pages where I want the information to be, then make a seperate html file with the information? Do I set up the new file with header and body tags?
| 7:50 pm on Dec 20, 2002 (gmt 0)|
Princess, just curious -- why not just use ssi?
| 7:52 pm on Dec 20, 2002 (gmt 0)|
you need php parsing for the file extension where you are placing the include statement.
You then place the include code in there making sure the path to the included file is correct no matter where on the site the page including it is located.
You could use
include $DOCUMENT_ROOT . "/somefile.html";
include $DOCUMENT_ROOT . "/includedir/somefile.html";
makes the path absolute so that it won't break.
new file with header and body tags
nope, php will take the content in the included file and put it into the other page as is. Only put the code to be included in there. You don't need anything extra. Look at the source through a browser once the include is in there and you will see more what I mean.
| 7:54 pm on Dec 20, 2002 (gmt 0)|
a very valid point if you use apache you can use something like
I think that syntax is right, been a while.
| 7:57 pm on Dec 20, 2002 (gmt 0)|
jatar_k: I do use apache--does that make a difference?
littleman: Because I don't know anything about SSI--that's what everyone keeps telling me to use, though. I don't know where to start with it...
| 8:00 pm on Dec 20, 2002 (gmt 0)|
the code I posted above is ssi, though I am not 100% sure of the syntax.
Take a look at this
| 8:01 pm on Dec 20, 2002 (gmt 0)|
SSI is more basic than php or perl.
| 8:02 pm on Dec 20, 2002 (gmt 0)|
Either of the above links should get you going.
| 8:03 pm on Dec 20, 2002 (gmt 0)|
princess, littleman's link is better than mine, more basic tutorial.
| 8:06 pm on Dec 20, 2002 (gmt 0)|
Thanks so much! This should keep me busy for awhile!