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 = 'www5965@christophercloyd.com';
$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.