Jump to content

ftp delete problem


desithugg

Recommended Posts

im having problem with this script
[code]
<?
$file1 = $_GET['file'];
if($file1 == "")
{
echo"You did not select which file to delete.";
exit;
}
$file = "/files/new/$file1";
?>
<?php
$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
ftp_close($conn_id);
echo"file deleted";
?>
[/code]

i keep getting the fallowing error
[quote]
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]
[/quote]
im not sure what to put as the server any ideas
Link to comment
Share on other sites

From the manual:

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

host
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.

Orio.
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.