Use php to change the ftp password

Source: Internet
Author: User
PHP: if (! ($ Fp @ ftp_connect ($ _ GET [host]) exit (unable to connect to the server); if (! @ Ftp_login ($ fp, $ _ GET [user], $ _ GET [pass]) exit (the specified password cannot be logged on); echo (@ ftp_site ($ fp, pswd. $ _ GET [pass] .. $ _ GET [newpass])? Password changed successfully: failed to change the password ;? Put the above PHP:
If (! ($ Fp = @ ftp_connect ($ _ GET ['host']) exit ('unable to connect to server ');
If (! @ Ftp_login ($ fp, $ _ GET ['user'], $ _ GET ['pass']) exit ('The specified password cannot be logged ');
Echo (@ ftp_site ($ fp, 'pswd '. $ _ GET ['pass']. ''. $ _ GET ['newpass'])? "Password modified successfully": "failed to change password ";
?>

Save the above code to a php file, such as chang. php.
Http://www.aaa.com/chang.php? Host = host & user = user & pass = password & newpass = new password

Can be modified, for example:
Http://www.aaa.com/chang.php? Host = ftp.aaa.com & user = test & pass = test & newpass = 123456

You can log on to ftp.aaa.com (log on with the password of test user and test) and change the password of test to 123456.
All you have to do is make a form.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.