Jump to content

chmod using php


chriscloyd

Recommended Posts

im trying to change the file permissions using chmod so i can unlink a file but how do i go ahead and do that
this is the error i have with my code
[code]
<?php
mysql_connect('localhost','www5965_chris','chriscloyd');
mysql_select_db('www5965_chris');
$id = $_GET['id'];
$query = mysql_query("SELECT name, type, size, path FROM upload2 WHERE id = '$id'");
while($test = mysql_fetch_array($query)) {
$ftp_user_name = '[email protected]';
$ftp_user_pass = '596511';
$ftp_root = '/';
$ftp_server = 'localhost';
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
chmod("upload_test/".$test['name'],0777);
unlink("upload_test/".$test['name']);
}
?>
[/code]

this is the error im getting


Warning: chmod() [function.chmod]: No such file or directory in /usr/home/www/public_html/delete.php on line 13

Warning: unlink(upload_test/steam.exe) [function.unlink]: No such file or directory in /usr/home/www/public_html/delete.php on line 14
Link to comment
https://forums.phpfreaks.com/topic/33321-chmod-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.