Page 1 of 1

chdir() then dir() class will this open current directory?

Posted: Tue Jul 29, 2003 2:31 pm
by kendall
Hello,

I have created a function the opens a dir

Code: Select all

<?php
// define root path
	chdir($BASEPATH); // set the current directory

	// if there is a category
	if(isset($category))
		chdir($category); // set current directory

	// if there is path
	if(isset($folder) && $folder != false)
		chdir($folder);// set current directory

	return	$dir = dir('.'); // open directory
?>
if $BASEPATH = /root/
and $category = /category/
and $folder = /folder/
would $dir = dir('.') = /root/category/folder/ ? Im having bit of a problem accessing some folders that i no are there i can't even seem to get a realpath(dir)

how is the chdir used with the dir() class??

Kendall

Posted: Tue Jul 29, 2003 3:35 pm
by Stoker
check that chdir() is successful, and use getcwd() to debug..
what path do you get?