


Tencent Weibo prompts missing parameter errorcode 102 error solution, parametererrorcode_PHP tutorial
Tencent Weibo prompts missing parameter errorcode 102 error solution, parametererrorcode
The example in this article describes the solution to the missing parameter errorcode 102 error prompted by Tencent Weibo. Share it with everyone for your reference. The specific analysis is as follows:
When debugging the Tencent Weibo interface today, an error occurred. There was no relevant information on the Internet. I finally adjusted it myself, so I published this article to avoid phpers from reinventing the wheel.
Error message, the code is as follows:
(
[data] =>
[detailerrinfo] => stdClass Object
(
[accesstoken] => [Apiname] = & GT; www.jb51.net
[appkey] => [clientip] => 112.193.138.133
[cmd] => [proctime] => 0
[ret1] => 3
[ret2] => 3
[ret3] => 102
[ret4] => [Timestamp] = & GT; 1394436892
)
[errcode] => 102
[msg] => missing parameter
[ret] => 3
[seqid] => 1394436894
)
In the official information of Tencent Weibo Open Platform, no development document explaining this error code 102 was found. After comparing with Tencent Weibo PHP SDK, it was found that one parameter was missing.
How to solve error code 102:
oauth_version is required in the parameter requesting user information, and in OAuth2, its value must be 2.a.
In the request parameters, the OAuth2 part must include:
Drupal Tencent Weibo login example code:
'query' => array(
'access_token' => $access_token,
'oauth_consumer_key' => $provider['key'],
'openid' => $_GET['openid'],
'clientip' => ip_address(),
'scope' => 'all',
'seqid' => REQUEST_TIME,
'serverip' => $_SERVER['SERVER_ADDR'],
'oauth_version' => '2.a',
//'appfrom' => 'php-sdk2.0beta',
),
)));
Note: After adding the fields, you need to re-authorize from the login page, otherwise the error "check sign error" will appear. Error code 36.
The following signature error return value caused by repeated refresh of the interface, the code is as follows:
(
[data] =>
[detailerrinfo] => stdClass Object
(
[accesstoken] => [apiname] => weibo.user.info
[appkey] => [clientip] => [cmd] => 0
[proctime] => 0
[ret1] => 3
[ret2] => 3
[ret3] => 36
[ret4] => 2636350730
[timestamp] => )
[errcode] => 36
[msg] => check sign error
[ret] => 3
[seqid] => 1394437227
)
Obtain Tencent Weibo user information and obtain the personal information of the currently logged in user. Field description of the return value of the user/info interface, the code is as follows:
Copy code
errcode: return error code,
msg: error message,
ret: return value, 0-success, non-0-failure,
data:
{
birth_day: day of birth,
birth_month: birth month,
birth_year : year of birth,
city_code: city id,
comp :
{
begin_year : starting year,
company_name: company name,
department_name: department name,
end_year: end year,
id: company id
},
country_code: country id,
edu : Educational information
{
departmentid: department id,
id: education information record id,
level: academic level,
schoolid: school id,
year : year of admission
},
fansnum: Number of listeners,
favnum: number of collections,
head: avatar url,
homecity_code: hometown city id,
homecountry_code: home country id,
homepage: personal homepage,
homeprovince_code: home province id,
hometown_code: hometown town id,
idolnum: Number of people listening,
industry_code: industry id,
introduction: personal introduction,
isent: whether it is a corporate organization,
ismyblack: Whether it is in the current user’s blacklist, 0-no, 1-yes,
ismyfans: Whether it is the current user’s audience, 0-no, 1-yes,
ismyidol: whether it is the idol of the current user, 0-no, 1-yes,
isrealname: Whether to use real-name authentication, 1-real-name authentication, 2-not real-name authentication,
isvip: whether to authenticate the user, 0-no, 1-yes,
location : location,
mutual_fans_num: Number of mutual listening friends,
name : user account name,
nick: User nickname,
openid: user’s unique id, corresponding to name,
province_code: region id,
regtime: registration time,
send_private_flag: Whether to allow everyone to send private messages to the current user, 0-only idols, 1-celebrities + listeners, 2-everyone,
sex: User gender, 1-male, 2-female, 0-not filled in,
tag : tag
{
id: personal tag id,
name: tag name
},
tweetinfo : The most recent original Weibo message
{
city_code: city code,
Country_code: country code,
emotiontype : emotion type,
emotionurl: mood picture url,
From : source,
fromurl: source url,
geo : geographical location information,
id: Weibo’s unique id,
Image: Image URL list,
latitude : latitude,
Location: The location of the publisher,
longitude : longitude,
music : audio information
{
Author : singer,
url: audio address,
Title: Audio name, song title
},
origtext : original content,
province_code: province code,
Self: Whether the Weibo is posted by oneself, 0-no, 1-yes,
Status: Weibo status, 0-normal, 1-system deleted, 2-under review, 3-user deleted, 4-root deleted,
text: Weibo content,
timestamp: server timestamp, cannot be used for page turning,
Type: Weibo type, 1-original post, 2-reprint, 3-private message, 4-reply, 5-blank reply, 6-mention, 7-comment,
video : video information
{
Picurl: thumbnail,
Player: player address,
realurl: video original address,
Shorturl: the short url of the video,
Title: video title
}
},
tweetnum: Number of Weibo posts published,
verifyinfo: certification information,
exp: experience value,
level: Weibo level
},
seqid: serial number
}
The rest is very easy, handle the logic business of your own program part.
I hope this article will be helpful to everyone’s PHP programming design.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP makes it easy to create interactive web content. 1) Dynamically generate content by embedding HTML and display it in real time based on user input or database data. 2) Process form submission and generate dynamic output to ensure that htmlspecialchars is used to prevent XSS. 3) Use MySQL to create a user registration system, and use password_hash and preprocessing statements to enhance security. Mastering these techniques will improve the efficiency of web development.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver CS6
Visual web development tools