Advertisement
Guest User

Untitled

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