<form action="ftp.php/" method="POST">
<p>Username<input name="username">
<p>Password<input name="password" type="password">
<p><input name="login" type="submit" value="login">
<?php
$conn = ftp_connect("ftp.elink2biz.com") or die("Could not connect");
ftp_login($conn,$login,$password);// print current directory
?>
</form>
Quote
Layzee wrote:
Why not try a solution that already exists?
How about something like this? ===> http://www.net2ftp.com/
Highly customable and multiuser support.
Just install that client as Webservice on your Webspace and link to it...
Anyway, if you want to use your own script, you'll find a good tutorial here:
http://www.raditha.com/php/ftp/
<?php
$ftp_server = "ftp.example.com";
$ftp_user = "username";
$ftp_pass = "password";
// Connection
$cid = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
// Try to login
if (@ftp_login($cid, $ftp_user, $ftp_pass)) {
echo "Logged in as $ftp_user@$ftp_server\n";
} else {
echo "Login as $ftp_user failed\n";
}
// Close connection
ftp_close($cid);
?>
//Make directory
ftp_mkdir($cid, $remote_dir);
//delete directory
ftp_rmdir($cid, $remote_dir);
//file upload
ftp_put($cid, $local_file, $remode_file, $modus);
//file download
ftp_get($cid, $local_file, $remote_file, $modus);
//close FTP-connection
ftp_close($cid);
<form action="ftp.php/" method="POST">
<p>Username<input name="username">
<p>Password<input name="password" type="password">
<p><input name="login" type="submit" value="login">
<?php
$ftp_server = "ftp.elink2biz.com";
$ftp_user = "username";
$ftp_pass = "password";
// Connection
$cid = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
// Try to login
if (@ftp_login($cid, $ftp_user, $ftp_pass)) {
echo "Logged in as $ftp_user@$ftp_server\n";
} else {
echo "Login as $ftp_user failed\n";
}
// Close connection
ftp_close($cid);
?>
Quote
Layzee wrote:
Why not try a solution that already exists?
How about something like this? ===> http://www.net2ftp.com/
Highly customable and multiuser support.
Just install that client as Webservice on your Webspace and link to it...
Anyway, if you want to use your own script, you'll find a good tutorial here:
http://www.raditha.com/php/ftp/
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
5 participants
Notifications
You are not receiving notifications from this thread.
Related Questions