
January 28th, 2004, 10:14 AM
|
 |
Mon The Biffy!
|
|
Join Date: Nov 2003
Location: Scotland
|
|
|
ftp problems
Hi. When I try to upload something it doesn't work. I have ftp enabled, i checked. here is my code:
PHP Code:
<?php
if(!empty($local))
{
$ftp_server = "";
$loginname = "";
$password = "";
//info above not given for obvious reasons
$connection = ftp_connect($ftp_server);
$login_result = ftp_login($connection, $loginname, $password);
if(!$connection || !$login_result)
{
print "Connection to FTP server disallowed!";
}
else
{
print "Connection made...\n";
}
$remote="/";
$upload = ftp_put($connection, $remote, $local, FTP_ASCII) or die("Can't upload file");
}
else
{
?>
<form action="<?php $PHP_SELF; ?>" method="post">
Upload file: <input type="file" name="local"><br>
<input type="submit" value="upload">
</form>
<?php
}
ftp_close($connection);
?>
I also get an error where it says I have called an undefined function ftp_close(). The last time I checked that was a function
fire
|