jatar_k

msg:1278393 | 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. <? include "somefile.html"; ?>
|
princess

msg:1278394 | 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?
|
littleman

msg:1278395 | 7:50 pm on Dec 20, 2002 (gmt 0) |
Princess, just curious -- why not just use ssi?
|
jatar_k

msg:1278396 | 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"; OR 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.
|
jatar_k

msg:1278397 | 7:54 pm on Dec 20, 2002 (gmt 0) |
a very valid point if you use apache you can use something like <!--#include virtual="somefile.html"--> I think that syntax is right, been a while.
|
princess

msg:1278398 | 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...
|
jatar_k

msg:1278399 | 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 [httpd.apache.org...]
|
littleman

msg:1278400 | 8:01 pm on Dec 20, 2002 (gmt 0) |
SSI is more basic than php or perl. [httpd.apache.org...]
|
littleman

msg:1278401 | 8:02 pm on Dec 20, 2002 (gmt 0) |
Either of the above links should get you going.
|
jatar_k

msg:1278402 | 8:03 pm on Dec 20, 2002 (gmt 0) |
princess, littleman's link is better than mine, more basic tutorial. thanks littleman
|
princess

msg:1278403 | 8:06 pm on Dec 20, 2002 (gmt 0) |
Thanks so much! This should keep me busy for awhile!
|
|