Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // login info
- $ftp_server = "ftp.headbite.com";
- $ftp_user = "headbite@headbite.com";
- $ftp_pass = "xxxxxxxxx";
- // set up a connection or die
- $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
- // try to login
- if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
- echo "Connected as $ftp_user@$ftp_server\n";
- } else {
- echo "Couldn't connect as $ftp_user\n";
- }
- //passive mode on
- ftp_pasv ( $conn_id, true );
- // upload a file
- $file = $_SESSION['base_path'] . "plugins\\fvLinks\\" . $_SESSION['userId'] . '_links.txt';
- $remote_file = "/headbite.com/subdomains/www/html/links/" . $_SESSION['userId'] . '_links.txt';
- if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
- echo "successfully uploaded $file\n";
- } else {
- echo "There was a problem while uploading $file\n";
- }
- // close the connection
- ftp_close($conn_id);
Add Comment
Please, Sign In to add comment