Ok have I got this right…. I’ve been looking around for answers, and pickin up some info and been baffled by others 😕
I have php set up at home as a testing server, I’m having troubles whit the include() function. Basically it not opening the files, and I figure it because the path in the php.ini file is not pointing to the directory I want it to.
To get it to work correctly is all I have to do is change the php.ini file to point to the given directory?
Eg
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes" //change this
I need to use the relative path to the document (eg ../../templates/file.inc not http://thedomain.com/blahblah..) so I can pass variables to the include script.
I have to get home to try out the above but is there another method to do it
If this worked it would be perfect
include(“../../templates/file.inc”) // but it wont work
I only ask because once I figure it out at home I have to figure it out/configure the server my site is on. Ide prefer a quick fix like include(“../../templates/file.inc”)
php.net inculde()
😉