Forum Moderators: coopster

Message Too Old, No Replies

chdir but like once like require_once?

         

JAB Creations

8:33 pm on Apr 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to use chdir but only once. Is there a way to stop chdir after a point in PHP? It keeps messing up my other scripts that I'm working on! :-D

jatar_k

8:49 pm on Apr 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well you should be able to check present dir against the one you want to change to, if you are already there then you don't need to change.

JAB Creations

10:25 pm on Apr 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks but honestly I have no clue what you mean. :-?>

jatar_k

4:30 pm on Apr 4, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well what is the script doing?
why does it need to chdir?
if it needs to have some dir be the working dir then there must be a way to check what working dir you are in and only change if it is not the right one.

I have never needed to use chdir in a script so I am sure there is another way to do it if multiple chdir's are causing an issue

JAB Creations

11:36 pm on Apr 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's vbulletin's Whose Online php script. But since vbulletin is in a dif dir and it I suppose needs to connect to other files it needs the chgdir syntax... now do I reset it to the way it is if I didn't include it?