NYCPHP Meetup

[nycphp-talk] php include file question

Sexton, David dsexton at ubspw.com
Mon Mar 31 13:36:02 EST 2003


I just noticed something strange. If I comment out my include directive in
php.ini, files in the same directory as the calling file are still included,
BUT stylesheets fail to be included. Basically, if I pull up a file that has
an include statement for another file, that other file's content is included
but the LINK tag is ignored for some reason. I don't understand why that
would happen. I am parsing through CSS and Javascript files, but it should
still work, shouldn't it?

-----Original Message-----
From: Hise, Jeremy [mailto:jhise at nextsource.com]
Sent: Monday, March 31, 2003 1:07 PM
To: NYPHP Talk
Subject: RE: [nycphp-talk] php include file question


You don't _HAVE_ to.

You DO have to if you have your include files in another location AND you
want to be able to say


include("mylib.php");

Otherwise, you have to do something along the lines of

include($GLOBALS['DOCUMENT_ROOT'] . "/../include/mylib.php");



-----Original Message-----
From: Sexton, David [mailto:dsexton at ubspw.com]
Sent: Monday, March 31, 2003 1:03 PM
To: NYPHP Talk
Subject: RE: [nycphp-talk] php include file question


Hi Deidra,

You have to add the directory that contains the files you wish to include to
the php.ini file.
There is a section for paths and directories in there:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"  
;include_path = ".:/php/includes"
;
; Windows: "\\path1;\\path2"
;include_path = ".;c:\\php\\includes;c:\\inetpub\\wwwroot\\"

Once you add the path, it should work.

-----Original Message-----
From: Deidra McIntyre [mailto:lists at redibishosting.com]
Sent: Monday, March 31, 2003 12:53 PM
To: NYPHP Talk
Subject: [nycphp-talk] php include file question


List,

I'm breaking up my html site into includes (header, copyright, etc.).
Within the HTML documents that call the include files, I have the
appropriate php tags (i.e. <? include("copyright.html"); ?> . All of the
includes (i.e. copyright.html) are sitting in the same directory as my
html pages (i.e. index.html). PHP is installed.

So, why, no matter what I do, don't the include files parse into my
document? I have tried to changed the include extensions from .html to
php to .inc. None parse. Most of my includes contain basic HTML (no php)
like <p>Copyright &copy; 2003. All Rights Reserved.</p>.

Am I doing something wrong? Or does my technician need to change something
in the server configuration (if so what)?

Thanks,
Deidra










****CONFIDENTIALITY NOTICE**** The Information in this email and any
attachments are confidential and intended to be reviewed by only the
individual or organization named above. If you have received this email in
error, please immediately notify the sender by return email and delete this
email from your system. Thank You.


--- Unsubscribe at http://nyphp.org/list/ ---




More information about the talk mailing list