Click to See Complete Forum and Search --> : Include file


~J~
10-22-2004, 09:17 PM
Morning...

Wonder if someone could help in what may be a simple question...

I know that on an ASP page I can use the Include command to bring in another file, but can I do this on a PHP page?

I have a page that contains a JavsScript popdown menu which I want on every page (don't want to use frames though), and I was wondering rather than have the code on EVERY page, if I could dynamically include it.

Anyone know if this is possible?

TIA

PeOfEo
10-22-2004, 11:06 PM
Yes. I am not a php user, but here is your syntax

<?PHP
include "include.inc";
?>

~J~
10-22-2004, 11:30 PM
Well that was more simple that I thought!! Feel silly now! lol.

Cheers for that, works perfectly...!

PeOfEo
10-22-2004, 11:34 PM
no problem man ;)

davidbrent
10-23-2004, 07:44 AM
just to clarify, you do not have to include a .inc file. you could use .php and .html and many other types if you want. people prefer .inc files becasue when viewed on their own the wont be expected to open fully.

~J~
10-23-2004, 08:02 AM
Thanks David,

That's exactly what I've done. PeOfEo put the Inc extension in his example, but I simply entered the full name of the file I wanted and it worked (it was actually a HTML file).

Cheers.

davidbrent
10-23-2004, 08:10 AM
Good stuff! good luck with your project.