Jump to content


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


ftp delete problem

Recommended Posts

im having problem with this script
$file1 = $_GET['file'];
if($file1 == "")
echo"You did not select which file to delete.";
$file = "/files/new/$file1";
$ftp_server = "ftp://desithugg.de.funpic.org/";
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, "desithugg", "password");

// try to delete $file
if (ftp_delete($conn_id, $file)) {
echo "$file deleted successful\n";
} else {
echo "could not delete $file\n";

// close the connection
echo"file deleted";

i keep getting the fallowing error
Fatal error: Call to undefined function: ftp_connect() in /usr/export/www/hosting/desithugg/deletefile.php on line 2
[b]$ftp_server = "ftp://desithugg.de.funpic.org/"; is line2[/b]
im not sure what to put as the server any ideas

Share this post

Link to post
Share on other sites
From the manual:

[quote]resource ftp_connect ( string host [, int port [, int timeout]] )

The FTP server address. This parameter shouldn't have any trailing slashes and [b]shouldn't be prefixed with ftp://[/b].[/quote]

Try removing the "ftp://" prefix.


Share this post

Link to post
Share on other sites


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.