Why the WeChat platform interface Test passed, but the real message but did not reply

Source: Internet
Author: User
The debug with its own message interface was successfully responded to, but the public number was not answered. And I found that in PHP I added a code to insert the database, and found that it was not running at all (the interface is running when debugging). What is the reason?


  Valid ();        }else{$this->responsemsg ();  }} Private Function Responsemsg () {//get post data, May is due to the different environments $postStr        = $GLOBALS ["Http_raw_post_data"]; Extract post Data if (!empty ($POSTSTR)) {/* Libxml_disable_entity_loader is to prevent XML Externa L Entity Injection, the best of the "to" check the validity of XML by yourself */Libxml_di                Sable_entity_loader (TRUE);                $POSTOBJ = simplexml_load_string ($postStr, ' simplexmlelement ', libxml_nocdata);                $fromUsername = $POSTOBJ->fromusername;                $toUsername = $POSTOBJ->tousername;                $keyword = Trim ($postObj->content);                $time = time (); $TEXTTPL = "
  
    
     %s 
     
    
     ! [cdata[%s]]> 
     
    
     %s 
                                
 msgtype> %s  
     %s 
     
    
      0 
     
   
  ";                    if (!empty ($keyword)) {$msgType = "text";                    $CONTENTSTR = "Welcome to WeChat world!";                    $RESULTSTR = sprintf ($TEXTTPL, $fromUsername, $toUsername, $time, $msgType, $keyword);                Echo $resultStr;                }else{echo "Input something ...";            }}else {echo "";        Exit        }} Private Function Test ($content) {$m = m (' list ');    return $m->execute ("UPDATE list SET website = ' {$content} ' WHERE name = ' Test '"); }}

Reply content:

The debug with its own message interface was successfully responded to, but the public number was not answered. And I found that in PHP I added a code to insert the database, and found that it was not running at all (the interface is running when debugging). What is the reason?


  Valid ();        }else{$this->responsemsg ();  }} Private Function Responsemsg () {//get post data, May is due to the different environments $postStr        = $GLOBALS ["Http_raw_post_data"]; Extract post Data if (!empty ($POSTSTR)) {/* Libxml_disable_entity_loader is to prevent XML Externa L Entity Injection, the best of the "to" check the validity of XML by yourself */Libxml_di                Sable_entity_loader (TRUE);                $POSTOBJ = simplexml_load_string ($postStr, ' simplexmlelement ', libxml_nocdata);                $fromUsername = $POSTOBJ->fromusername;                $toUsername = $POSTOBJ->tousername;                $keyword = Trim ($postObj->content);                $time = time (); $TEXTTPL = "
  
    
     %s 
     
    
     ! [cdata[%s]]> 
     
    
     %s 
                                
 msgtype> %s  
     %s 
     
    
      0 
     
   
  ";                    if (!empty ($keyword)) {$msgType = "text";                    $CONTENTSTR = "Welcome to WeChat world!";                    $RESULTSTR = sprintf ($TEXTTPL, $fromUsername, $toUsername, $time, $msgType, $keyword);                Echo $resultStr;                }else{echo "Input something ...";            }}else {echo "";        Exit        }} Private Function Test ($content) {$m = m (' list ');    return $m->execute ("UPDATE list SET website = ' {$content} ' WHERE name = ' Test '"); }}

... You do not post code how to analyze
Are you going to let the couple pinch the finger for you?

Follow the public number push is an event, see the development documentation

interface debugging, you can use File_put_content to log some information to log, send a message try, I was the same tune

  • 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.