ftp funtions
| From: | Brandon Feldhahn | Date: | Mon, 04 Dec 2000 06:41:24 +0000 |
| Subject: | ftp funtions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28535@lists.php.net to get a copy of this message | ||
this is my code:
<html>
<head>
<title>FTP</title>
</head>
<body>
<?php
// set up basic connection
$conn_id = ftp_connect("192.168.1.4");
// login with username and password
$login_result = ftp_login($conn_id, "brandon", "******");
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "Ftp connection has failed!";
echo "Attempted to connect to $ftp_server for user $user";
die;
} else {
echo "Connected to $ftp_server, for user $user";
}
// upload the file
$upload = ftp_put($conn_id, "$destination_file", "$source_file",
FTP_BINARY);
// check upload status
if (!$upload) {
echo "Ftp upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as
$destination_file";
}
// close the FTP stream
ftp_quit($conn_id);
?>
</body>
</html>
this is my error:
Warning: ftp_login: Can't login : invalid Home Directory ! in
C:\www\ftp.PHP on line 11
Ftp connection has failed!Attempted to connect to for user
what am i doing wrong, thank you.
IT'S URGENT!