WeChat/Forex Public Platform Development (4): Public number Debugger (emulation WeChat platform, provide PHP source code)

Source: Internet
Author: User
Tags php source code
/Forex Public Platform Development (IV): Public number debugger (emulation platform, provide PHP source code)


When developing/Forex a public platform, debugging is often cumbersome and can only be changed on the top of the phone, or in the server to write logs. When your server script has a bug, the phone is not displayed, tracing is not easy. During the development process, I wrote a debugger that can simulate/forex the platform, access the public number URL and display detailed response data, and debug the public number becomes easy. Special share to everyone.


Debugger Address: http://www.jostudio.org/emulator.php


The interface is as follows: Enter the public number URL, send a text message, can display the response data. Side development, side debugging.




The debugger can send text message, enter text content, press "Send text message" button.

The debugger can also simulate menu click, enter menu Eventkey value, press "click menu" button.

The debugger can also simulate user concerns by pressing the "start from scratch" key, at which point the debugger sends a SUBSCRIBE message to the public number URL.


If there is an error in the public URL response process, it will also come out in the return data display, debugging is very useful!


Note: When the debugger sends a message to the public number URL, the sender's OpenID is "Emulator_user"



Mystery function: This debugger can access any URL, just like a Web proxy, such as: Show Access www.baidu.com, click "Start from scratch", you can see the return data.

Why is the Chinese of the returned data garbled? This is because baidu.com returns the GBK encoded kanji, and the debugger follows the platform rules, using the UTF-8 encoded Kanji. Please tick the "return data is GBK encoding" option, click "Start from scratch" to submit again, then return the result Chinese is not garbled.




Tick "Return data is GBK encoded", click "Start from scratch" to access www.baidu.com again, the results show "page does not exist." Why is it? This is because the debugger follows the platform rules, automatically adds a signature value after the URL, and the URL is accessed by post, so Baidu does not think the URL exists.


Check "Get URL access" option, and do not tick "return data is GBK encoding", click "Start from scratch" to access www.baidu.com again, this time normal.

PS: Baidu Home is utf-8 code, error page is GBK code


Note: The above process is an experiment to visit other websites, do not check the "Get URL" and "Return data is GBK encoding" option when actually debugging the public number URL


Hey, again god a little, visit www.facebook.com to you to see, the webpage will come out in a moment, all say can visit any URL Luo, is not? Is this the turn of the wall?! Yes, to the enemy!

(However, I'm sorry, the debugger just reads and displays the Web page, and does not complete the functions of the Web proxy, so it cannot be logged on to Facebook)






For the debugger source of interest in children's shoes, can be downloaded in my resources: Debugger source code Download


Source only one file emulator.php, can be installed on their own server


Don't explain, read the source comment





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