PHP Page Execution order issues

Source: Internet
Author: User
The problem has been resolved ... is the next section of the program error, so do not execute, but the server did not open the error, no display. Thanks

Click on a page, the page, will submit a request to the third-party server, the third-party server will return data, the page based on the return data to determine the next execution. However, after the data is returned, the remaining code cannot be executed.

So I want to ask.

The code is similar so that after $json _result is acquired, the following is not performed.

if ($action = = "GetUserInfo")
{
$json _result = $httpservermgr->https_request ($url);//Submit with Curl
}
if (determine if the condition is satisfied in the Json_result)
{
Get user Information display:
}
Else
{
No get show ...
}

Reply content:

The problem has been resolved ... is the next section of the program error, so do not execute, but the server did not open the error, no display. Thank you

Click on a page, the page, will submit a request to the third-party server, the third-party server will return data, the page based on the return data to determine the next execution. However, after the data is returned, the remaining code cannot be executed.

So I want to ask.

The code is similar so that after $json _result is acquired, the following is not performed.

if ($action = = "GetUserInfo")
{
$json _result = $httpservermgr->https_request ($url);//Submit with Curl
}
if (determine if the condition is satisfied in the Json_result)
{
Get user Information display:
}
Else
{
No get show ...
}

What do you mean, what code is not executed? Check if there is an error in CURL.

Print out the $json_result first to see if the content is correct.

You have encountered this problem before because you requested a URL for HTTPS, but you did not configure it in php.ini:

curl http://curl.haxx.se/ca/cacert.pem -o /opt/openssl/ssl/cert.pem

if ($action = = = ' GetUserInfo ')
{

$json_result = $httpservermgr->https_request($url);//用curl提交if(判断json_result里是否满足条件){//获取用户信息显示。。}else{//没有获取显示。。。}

}elseif ($action = = = ' XXXXX ') {

$json_result = $httpservermgr->https_request($url);//用curl提交if(判断json_result里是否满足条件){//获取用户信息显示。。}else{//没有获取显示。。。}

}else{

}

Let me give you a tip. Error prompting for PHP to debug by printing a variable (var_dump function) It is possible that a third-party class library is improperly used to cause the program to stop running

$json_result = "";  //先定义if($action=="getUserInfo"){$json_result = $httpservermgr->https_request($url);//用curl提交}if(! empty($json_result)){var_dump($json_result)//获取用户信息显示。。}else{echo "没有数据";//没有获取显示。。。}
  • Related Article

    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.