•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,486 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,253 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 300 | Replies: 2
•
•
Join Date: May 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
I need a working code for deleting an uploded file on the ftp server.I do have a script but it dosn't work..
this code is not able to find the old.txt,but this file is placed in the same directory where the script is located.
<?php
// set up the settings
$file = 'old.txt';
$ftp_server = someone.net';
$ftpuser = 'user';
$ftppass = 'passwd';
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftpuser, $ftppass);
// try to delete $file
if (ftp_delete($conn_id, $file)) { // the ftp function
echo "$file deleted successful\n";
} else {
echo "could not delete $file\n";
}
// close the connection
ftp_close($conn_id);
?>this code is not able to find the old.txt,but this file is placed in the same directory where the script is located.
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: wampserver 2.0 domain name
- Next Thread: isp auto-detect



Threaded Mode