Re: On more time with PATHS!

From: Date: Tue, 22 Apr 2003 17:06:01 +0000
Subject: Re: On more time with PATHS!
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-144762@lists.php.net to get a copy of this message
sorry but i don't know what you are trying to say here. e.g /******************* INDEX.PHP ******************- $strPath="./" // i am at the root require_once ($strPath."include/header.php") // there is a include folder on the main include header from that folder. /************************* HEADER.PHP ***************************/ require_once($strPath."conn/conn.php") // whereever goto there a include this require_once ($strPath."security/securityfile.php") require_once ($strPath."functions/funclist.php") /************************** CONN.PHP ******************************/ (this file is just a link to another file) require_once($strPath."controlpanel/conn/conn.php") // the actual conn file is in the controlpanel /********************** funclist.php *************************************/ reuqire_once($strPath."database/classes/mySql.inc") -------------------------------------------------------------------------- you should include the $strPath once never twice. the paths wont change well i think you get this problem Haseeb Creativity is inventing, experimenting, growing, taking risks, breaking rules, making mistakes, and having fun. Haseeb Iqbal ----- Original Message ----- From: "C.R." <odcs@rogers.com> To: "Kevin Stone" <kevin@helpelf.com>; "PHP General" <php-general@lists.php.net> Sent: Tuesday, April 22, 2003 3:50 AM Subject: Re: [PHP] On more time with PATHS! > I understand what you are saying, but what if a particular file needs to be > included from a number of files that are in other included files - then the > path is screwed up - or if the included file has other included files, which > then includes the included file itself - I'm not sure if your following what > I am saying here - but you can see the chain of includes gets so deep - how > is it possible to keep it straight. In these cases your suggestion won't > work - ../file.php may be correct for file 'a', but if this is included from > file 'c' and 'e', then ../file.php is no longer correct. it may be > ../../file.php or maybe just /file.php. depending on where the original > script was run from..... > > I don't know - but right now I am spending 90% of my time trying to figure > this out and 10% on the script itself. > > > ----- Original Message ----- > From: "Kevin Stone" <kevin@helpelf.com> > To: "C.R." <odcs@rogers.com>; "PHP General" > <php-general@lists.php.net> > Sent: Monday, April 21, 2003 2:43 PM > Subject: Re: [PHP] On more time with PATHS! > > > > ----- Original Message ----- > > From: "C.R." <odcs@rogers.com> > > To: "PHP General" <php-general@lists.php.net> > > Sent: Monday, April 21, 2003 12:08 PM > > Subject: [PHP] On more time with PATHS! > > > > > > > You guys are probably getting tired of reading my emails, but this > > > path/include problem is just never ending. I don't even know how to > > explain > > > the problem because I don't understand it. I am simply trying to include > > > files that are in the same directory or directory structure, but no > matter > > > what I do I get the same damn message that this or that file can't be > > > found - I have tried giving it the exact path, the exact url, and > anything > > > else I can think of - but somewhere along the line - some file won't be > > > found. > > > > > > I think the problem is this, but I have no idea how to solve it. If I > > > include a file which also includes other files - then the path structure > > > somehow gets screwed up. How do I keep them straight through multiple > > > includes and directories. I don't know if I am making any sense - but > this > > > is my last ditch effrot on this before I move on to some other way of > > doing > > > this - whether it be java, asp, or whatever. > > > > > > Everyone in here has been great, but I am to the point now where I am > just > > > fed up with PHP because of this bloody issue. > > > > > > Thanks > > > > > > C.R. > > > > Use the absolute path beginning from the account's root directory. echo > > $_SERVER['DOCUMENT_ROOT']; So if you need to go back one directory and > then > > into a folder called "functions" you'd simply do.. > > > > <? // include test > > $root = $_SERVER['DOCUMENT_ROOT']."/"; > > include($root."../functions/myfunctions.php"); > > ?> > > > > Got it? Good luck. :) > > > > - Kevin > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#144762) next »