Functions in php that may be used to encrypt strings [base64_encode, urlencode, sha1]

Source: Internet
Author: User
What I encountered when I used Sina Weibo to perform automatic login was that as a big newbie, even the login script was written by someone else and used it for modification, in the end, I realized that the script was used to obtain cookies. it was really slow to respond, or the principle of logging on without intention was quite complicated, as I thought, it was too simple to get the page from curl and then post it.

Sort out the price processing string functions:

The code is as follows:


$ Encryption = "username ";
Echo base64_encode ($ encryption); // echo "dXNlcm5hbWU = ";
Echo"
";
Echo urlencode ("http: //". $ encryption); // echo "http % 3A % 2F % 2 Fusername ";
Echo"
";
Echo sha1 ($ encryption); // echo "249ba36da-29bbe97499c03db5a9001f6b734ec"
Echo"
";
?>


Record their approximate appearance so that class processing can be quickly identified in the future.

By the way I found the script at the time of the article address: http://www.jb51.net/article/29486.htm

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.