Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- Welcome <?php echo $_POST["name"]; ?><br>
- Your email address is: <?php echo $_POST["email"]; ?>
- <?php
- $ftp_server = "149.202.249.9";
- $ftp_user = "160";
- $ftp_pass = "654fearboss";
- // 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";
- }
- echo "Current directory: " . ftp_pwd($conn_id) . "\n";
- if (ftp_chdir($conn_id, "scriptfiles")) {
- echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
- } else {
- echo "Couldn't change directory\n";
- }
- if (ftp_chdir($conn_id, "users")) {
- echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
- } else {
- echo "Couldn't change directory\n";
- }
- $path = "/scriptfiles/users/"; //the path where the file is located
- $file = $_POST["name]; //the file you are looking for
- $check_file_exist = $path.$file; //combine string for easy use
- $contents_on_server = ftp_nlist($conn_id, $path); //Returns an array of filenames from the specified directory on success or FALSE on error
- var_dump($contents_on_server);
- ftp_close($conn_id);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement