PDA

View Full Version : PHP Includes



Toefur
August 3rd, 2002, 00:51
Something simple - How does one include html files into php documents?

It's a simple thing, but I can't find it anywhere whilst searching throhgh google.

Canuckkev
August 3rd, 2002, 00:53
It only works for local files...which I think you know.

http://www.php.net/manual/en/function.include.php

Just


include("/path/to/file.html");

biggulp
August 3rd, 2002, 02:41
no, it can include files across http or ftp as well.

include("http://www.google.com");

Toefur
August 3rd, 2002, 12:47
Thanks lad!

... Wow, can you really include from other sites? That'd give a pretty strange result; wouldn't it? I don't see how that would work, if you included an entire website into the page... maybe I will try it see what it does. :confused:

Canuckkev
August 3rd, 2002, 21:15
Oh yea, I guess it can include remote files.

But heed this warning:


The Windows version of PHP currently does not support remote file accessing for this function, even if allow_url_fopen is enabled.