Php page execution sequence

Source: Internet
Author: User
The problem has been solved... It is a later program error, so do not execute, but the server did not enable the error, not displayed. When you click a page, a request will be submitted to the third-party server, and the third-party server will return data. The page will be determined based on the returned data... The problem has been solved... It is a later program error, so do not execute, but the server did not enable the error, not displayed. Thank you.

When you click a page, a request is submitted to the third-party server. The third-party server returns data, and the page determines the next step based on the returned data. However, after the data is returned, the remaining Code cannot be executed.

So I want to ask.

The code is similar. After $ json_result is obtained, the following will not be executed.

If ($ action = "getUserInfo ")
{
$ Json_result = $ httpservermgr-> https_request ($ url); // submit with curl
}
If (determine whether conditions are met in json_result)
{
// Obtain the user information display ..
}
Else
{
// No display is obtained...
}

Reply content:

The problem has been solved... It is a later program error, so do not execute, but the server did not enable the error, not displayed. Thank you.

When you click a page, a request is submitted to the third-party server. The third-party server returns data, and the page determines the next step based on the returned data. However, after the data is returned, the remaining Code cannot be executed.

So I want to ask.

The code is similar. After $ json_result is obtained, the following will not be executed.

If ($ action = "getUserInfo ")
{
$ Json_result = $ httpservermgr-> https_request ($ url); // submit with curl
}
If (determine whether conditions are met in json_result)
{
// Obtain the user information display ..
}
Else
{
// No display is obtained...
}

What do you mean? What code is not executed? Check whether errors occur during CURL.

Print $ json_result first to check whether the content is correct.

I have encountered such a problem before because I requested an https url but it was not configured 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); // use curl to submit if (determine whether conditions are met in json_result) {// obtain the user information display ..} Else {// No display is obtained ...}

} Elseif ($ action = 'xxxxx '){

$ Json_result = $ httpservermgr-> https_request ($ url); // use curl to submit if (determine whether conditions are met in json_result) {// obtain the user information display ..} Else {// No display is obtained ...}

} Else {

}

It is recommended that you enable the PHP error prompt to debug the program by printing the variable (var_dump function). It may be because the third-party class library is incorrectly used and the program stops running.

$ Json_result = ""; // first define if ($ action = "getUserInfo") {$ json_result = $ httpservermgr-> https_request ($ url ); // submit with curl} if (! Empty ($ json_result) {var_dump ($ json_result) // obtain the user information display ..} Else {echo "no data"; // No display is obtained ...}

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.