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