Do you have a question? Post it now! No Registration Necessary. Now with pictures!
March 7, 2007, 8:52 pm
rate this thread
I have a question about file locations, and whether on not (in my
case, not) a page will execute depending
on the location of the php file.
I have a web devel server, with a directory below htdocs (using Apache
2.2 on Fedora Linux)
/usr/local/apache2/htdocs/portfolios and /usr/local/apache2/htdocs/
I thought it would be nice to put pages that involve moving files
around, adding data to a mysql database,
etc in a directory called "setup" I have another path /usr/local/
that I read with my page, and copy data from the testimage dir into a
database. I use code like below
$path = 'testimage';
$dir_handle = @opendir($path) or die("Unable to open directory
/*** Load an array with the list of files in the dir ***/
while ($file = readdir($dir_handle))
//$filetyp =getFileType($file); no good for all images???OR $filetyp
$filetyp = strtolower(substr($file, -3));
if ($filetyp == 'jpg' )
//***$handle = fopen($path . "/" . $file,'r');
$filelist[$idx] = $path . "/" . $file; //add file to array
//***$file_content = fread($handle,filesize($path . "/" . $file));
I use the echo command to see if the files in the dir are being read,
etc. this works when the php page is located in ..../portfolios, but
if i try to run the php page from ..../portfolios/setup, I do not read
I rename the path to "../testimage" to backout of the "setup"
directory. I am guessing I am not defining the path correctly? Also
just to be sure (intranet development site only) i open the
permissions on "testimage" so all can read and write and execute.
Even with that I return no file names.
What am I missing???
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum