Jump to content

Archived

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

desithugg

ftp delete problem

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

Share this post


Link to post
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.

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.