473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

directory access and file locations

Hello PHP group,

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/
portfolios/setup

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/
apache2/htdocs/portfolios/testimage
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
$path");

/*** 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
== 'gif'
$filetyp = strtolower(substr($file, -3));
if ($filetyp == 'jpg' )
{
$filecount++;
//***$handle = fopen($path . "/" . $file,'r');
$filelist[$idx] = $path . "/" . $file; //add file to array
//echo $filelist[$idx];
$idx++;
//***$file_content = fread($handle,filesize($path . "/" . $file));
//***fclose($handle);

}
}
closedir($dir_handle);

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
any files.
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???

thanks,

ewholz

Mar 7 '07 #1
0 1243

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tracy Tripp | last post by:
I'm working on a program that takes files by path and moves them into new locations, and then back again if the user intends. Everything is great so far except I cannot figure out how to keep...
4
by: Peter Larsson | last post by:
Hello everybody, I'm developing a system for a company that has production at two different locations. The production is stored in an Access database at each location, and I need to find a way...
1
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
29
by: DFS | last post by:
From an Access 2003 module: v = Shell("ftp.exe -s:D:\ftpCommands.txt") Contents of D:\ftpCommands.txt ---------------------------------- open ftp.destination.com user password send sourceFile...
4
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
Best way I can think to describe this is through an example. I have a virtual directory, let's call it "MyVirtualDirectory" that maps to \\MyServer\Shared. I have a path that is...
2
by: aaragon | last post by:
Hi everyone, my question is probably trivial but I couldn't find a way to do it. Is there a way to tell the compiler about a directory where it has to look for some files? For example, I'm trying...
5
by: Rocky | last post by:
My Access 2007 file fails to open on a machine with the 2007 Access runtime version installed. It comes up with a Security alert message. Is there a security setting in the Access Database that...
0
by: DeskUser | last post by:
Hello I have an asp.net application installed in several locations (framework 1.1). One of my clients is having a strange error when trying to access a certain aspx page:
1
by: SGilch | last post by:
I am new to javascript, and wondering if it is capable of implementing a browsing mechanism for the browser to upload the names of files in a client side directory to the server. The client would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.