Php frontend and backend transmission?

Source: Internet
Author: User
Php frontend and backend transmission? How does the front-end transmit data to the backend? How does the background receive data from the front end? Use JSON_ENCODE ($? How does the background send data back to the front end?
$. Post ('', {'qnumber': qnumber}, function (data ){

}, 'Json ');? What does this mean?


Reply to discussion (solution)

$. Post indicates that you use post to send data.
The first parameter next to the backend processing page. use $ _ POST to retrieve your data.
{'Qnumber': qnumber} is obtained on the background page using $ _ POST ['qnumber '].
After the background page is processed, the json output is the page you want to return to the front-end
For example:
$ Return ['status'] = 1;
$ Return ['MSG '] = 'Operation successful ';
Echo json_encode ($ return );

How does the front-end transmit data to the backend? How does the background receive data from the front end? Use JSON_ENCODE ($? How does the background send data back to the front end?
$. Post ('', {'qnumber': qnumber}, function (data ){

}, 'Json ');? What does this mean?

How can I transmit the front-end qNumber to the backend? How to receive the background json_encode ($ );

How does the front-end transmit data to the backend?
The browser sends data to the background in the GET or POST mode, and the background receives data in the normal GET or POST mode.

How does the background send data back to the front end?
Of course, it was sent in the format required by the front-end. who told you to be a service provider?

$. Post ('', {'qnumber': qnumber}, function (data) {}, 'json ');
Notify jQuery to interpret the returned data as json
However, php cannot receive this notification. Therefore, php can only return data as agreed

Can I use an example?

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.