Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Testing the FTP Module
- error_reporting(2047); // 2047 is everything
- $ftpHost = "173.203.139.154";
- $ftpPort = "21";
- $ftpUser = "djohn";
- $ftpPassword = "i77k3m88-$#";
- if(function_exists('ftp_connect')) {
- echo "ftp_connect() function is enabled <br/>";
- $ftpResource = ftp_connect($ftpHost, $ftpPort);
- if(!$ftpResource)
- {
- echo "Could not connect to: ".$ftpHost." using port: ".$ftpPort."<br/>";
- }
- else
- {
- echo "Connected to: ".$ftpHost."<br/>";
- // Testing login with user / pass
- if(!ftp_login($ftpResource, $ftpUser, $ftpPassword))
- {
- echo "Could not log in with username: ".$ftpUser." and password: ".$ftpPassword."<br/>";
- }
- else
- {
- echo "Success! We are now logged in with: ".$ftpUser;
- }
- }
- }
- else {
- echo "ftp_connect() function or the php ftp module is not enabled on this server. Exiting...";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement