LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   #include file (https://www.linuxquestions.org/questions/linux-newbie-8/include-file-52712/)

Cynthia Blue 03-31-2003 01:05 PM

#include file
 
I believe in windows, ASP and such, you can drop in a commented code like #include file="blah blah" and it will pull in another page into your page.

Is this possible in Linux? I run a Red Hat 8 box, apache, php, mysql... and I'd like to include an external .htm file from a different location into one of my web pages.

Thanks.

bahamat 03-31-2003 02:11 PM

php use the requre() function.

Cynthia Blue 03-31-2003 03:14 PM

The file is just an .htm file... I could change it to php, but I'd rather not. :)
Thanks.

bahamat 03-31-2003 03:19 PM

did you try it first? does it give you an error?

If it needs to be php there's no harm in changing it. If there's no php tags it will just return the document as-is.

You could also just use server side includes.

mhearn 03-31-2003 03:26 PM

Yes, this is done the same way, google for apache server side includes

Cynthia Blue 03-31-2003 05:49 PM

Okay did the search, got a tutorial I applied. It works good... unless I try to include a file which is on a seperate server, different machine, different URL. I include the full URL path.. or does that work differently?
Thanks

bahamat 03-31-2003 06:33 PM

you can't include a file on another machine unless you do it with nfs or some other type of mountable remote file system.


All times are GMT -5. The time now is 01:25 PM.