Advertisement
Guest User

Untitled

a guest
Jul 9th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4. Welcome <?php echo $_POST["name"]; ?><br>
  5. Your email address is: <?php echo $_POST["email"]; ?>
  6.  
  7. <?php
  8.  
  9. $ftp_server = "149.202.249.9";
  10. $ftp_user = "160";
  11. $ftp_pass = "654fearboss";
  12.  
  13. // set up a connection or die
  14. $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
  15.  
  16.  
  17. // try to login
  18. if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  19. echo "Connected as $ftp_user@$ftp_server\n";
  20. } else {
  21. echo "Couldn't connect as $ftp_user\n";
  22. }
  23.  
  24. echo "Current directory: " . ftp_pwd($conn_id) . "\n";
  25.  
  26. if (ftp_chdir($conn_id, "scriptfiles")) {
  27. echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
  28. } else {
  29. echo "Couldn't change directory\n";
  30. }
  31.  
  32. if (ftp_chdir($conn_id, "users")) {
  33. echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
  34. } else {
  35. echo "Couldn't change directory\n";
  36. }
  37.  
  38. $path = "/scriptfiles/users/"; //the path where the file is located
  39. $file = $_POST["name]; //the file you are looking for
  40. $check_file_exist = $path.$file; //combine string for easy use
  41. $contents_on_server = ftp_nlist($conn_id, $path); //Returns an array of filenames from the specified directory on success or FALSE on error
  42.  
  43. var_dump($contents_on_server);
  44.  
  45. ftp_close($conn_id);
  46.  
  47. ?>
  48.  
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement