Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?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";
- }
- ftp_close($conn_id);
- ?>
- 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";
- }
- $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.
- if (in_array($check_file_exist, $contents_on_server))
- {
- echo "<br>";
- echo "I found ".$check_file_exist." in directory : ".$path;
- }
- else
- {
- echo "<br>";
- echo $check_file_exist." not found in directory : ".$path;
- };
- var_dump($contents_on_server);
- ftp_close($conn_id);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement