note 113226 added to function.ftp-put

From: Date: Sun, 15 Sep 2013 09:08:29 +0000
Subject: note 113226 added to function.ftp-put
Groups: php.notes 
Request: Send a blank email to php-notes+get-196260@lists.php.net to get a copy of this message
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple FTP Upload Script using PHP by 2netlodge</title> </head> <body> <?php if(isset($_POST['ftp'])) { $ftp = $_POST['ftp']; $username = $_POST['username']; $pwd = $_POST['pwd']; $filename = $_FILES['file']['name']; $tmp = $_FILES['file']['tmp_name']; $d = $_POST['des']; $connect = ftp_connect($ftp)or die("Unable to connect to host"); ftp_login($connect,$username,$pwd)or die("Authorization Failed"); echo "Connected!<br/>"; if(!$filename) { echo"Please select a file"; } else { ftp_put($connect,$d.'/'.$filename,$tmp,FTP_ASCII)or die("Unable to upload"); echo"File successfully uploaded to FTP"; } } ?> <form action="" method="post" enctype="multipart/form-data"> <input type="text" name="ftp" placeholder="FTP link"/><br/> <input type="text" name="username" placeholder="Username"/><br/> <input type="password" name="pwd" placeholder="Password"/><br/> <input type="file" name="file" /><br/> <input type="text" name="des" placeholder="Destination" /><br/> <br/><input type="submit" value="Upload"/></form> </body> </html> ---- Server IP: 69.147.83.199 Probable Submitter: 198.55.107.196 ---- Manual Page -- http://php.net/manual/en/function.ftp-put.php Edit -- https://master.php.net/note/edit/113226 Del: integrated -- https://master.php.net/note/delete/113226/integrated Del: useless -- https://master.php.net/note/delete/113226/useless Del: bad code -- https://master.php.net/note/delete/113226/bad+code Del: spam -- https://master.php.net/note/delete/113226/spam Del: non-english -- https://master.php.net/note/delete/113226/non-english Del: in docs -- https://master.php.net/note/delete/113226/in+docs Del: other reasons-- https://master.php.net/note/delete/113226 Reject -- https://master.php.net/note/reject/113226 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196260) next »