Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passthru() not working

Status
Not open for further replies.

shangrilla

Programmer
Nov 21, 2001
360
US
Hi:

passthru("rm -f n10234*",$retstr);
if($retstr=="1")
echo &quot;File Delete failed<br>&quot;;

I am using this to delete all files with file name starting with n10234*.*

It works from the command prompt but when when I put this in a php file, it doesn't delete the files. I don't even get the message saying &quot;File Delete failed&quot;. So I am guessing that passhtru is working, but something else is wrong.

Any Suggestions?
 
Did you try adding the path to the filename? Also, does the webserver user have the rights to delete the files? //Daniel
 
When I access the folder that contains all these files using wsftp. The OWNER has read, write, and execute. Group and other have read, and execute. I still cannot get it to delete the files.
 
Who is the owner of the files? If the owner isn't the same as the websever user, add write permissions for other as well. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top