Jump to content


Photo

ftp delete problem


  • Please log in to reply
1 reply to this topic

#1 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 07 October 2006 - 03:49 PM

im having problem with this script
<?
$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";
?> 

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
$ftp_server = "ftp://desithugg.de.funpic.org/"; is line2

im not sure what to put as the server any ideas


#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 07 October 2006 - 04:10 PM

From the manual:

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

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


Try removing the "ftp://" prefix.

Orio.
Think you're smarty?

(Gone until 20 to November)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users