PHP front-end and background transfer? What to do with it
Source: Internet
Author: User
PHP front-end and background transfer?
How does the front end pass data to the background? How does the background receive data from the front end? With Json_encode ($A)? How does the background send the data back to the front end?
$.post (', {' QNumber ': qnumber},function (data) {
}, ' json '); What does that mean?
------to solve the idea----------------------
$.post, which means you send data by post
After the first parameter, the background processing page, use $_post to get the data you passed
{' QNumber ': qnumber} background page obtained with $_post[' QNumber ']
After the background page processing is finished, JSON outputs the page you want to return to the front end
Such as:
$return [' Status ']=1;
$return [' msg ']= ' Operation succeeded ';
echo Json_encode ($return);
------to solve the idea----------------------
How does the front end pass data to the background?
The browser sends data to the background in a GET or post manner, and the background is received as normal get or post
How does the background send the data back to the front end?
Of course, according to the format required by the front-end sent, who call you a service party?
$.post (', {' QNumber ': qnumber},function (data) {}, ' json');
Notifies JQuery to interpret the returned data as JSON
But this notice PHP is not received. So PHP can only return the data according to the prior agreement
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