PHP third-party login-Weibo login

Source: Internet
Author: User

1: Before you develop, please familiarize yourself with the principle of OAuth protocol.

2: We need to have an external network to access the online domain name, if not, please go to Sina SAE platform to apply for a temporary online domain name in the development.

3: First we enter the Sina Weibo open platform http://open.weibo.com/, login after the developer registration, improve personal information, as far as possible to fill in the real information.

4: Then we go to the homepage

Enter

Verifying the legality of the website

Click My Apps

Click on site Information

Below you will see the values we want.

Click the document

Click the SDK to download

Click Phpsdk to download

5: Download successful, unzip

A total of eight files

6: A brief look at this core SDK (the only file left above)

7: Create a portal file index.php( Note that offline development, we need to configure the domain name must be the same as the online domain name or the domain name on the SAE, for example: online domain name Www.weibo.com, then we need to match a domain name like this: www.test.weibo.com)

8: Create config.php, put Sina development platform App_key and App_secret on the inside, convenient to call

9: Create wb_login.php Login file (arbitrarily defined)

10: When we jump to the callback address, we bring back a code parameter that we can get through this code parameter Access_token

11: Make Login status judgment, login display logged in status, not login display login logo

12: By this step our Weibo login is almost there, so let's show you some of the interfaces that call the microblog.

We call the microblogging interface, pass three necessary parameters, the other parameters are optional, so that we have a micro-blog on the new tweet (automatically after landing, code in the index.php entrance file)

Small partners can also call other interfaces to do the necessary operations, details can refer to the official Weibo platform API documentation, thank you for your support!!!

PHP third-party login-Weibo login

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.