How can I transmit JavaScript data to PHP? The status quo is as follows: after using Sina API to implement login, JS callback functions will be called: function & nbsp; login (o) & nbsp ;{}& nbsp; the input parameter o is the JSON of the user information. now I want to display the data at the front end, but PHP is executed in the background. & how can I transmit the data in JavaScript to PHP?
The status quo is as follows:
After using Sina API to implement login, the callback function of JS will be called:
Function login (o ){
}
The input parameter o is the JSON of the user information. now I want to retrieve this data and display it on the front end,
However, PHP is executed in the background, so I want to use window. location. href to jump to another PHP page,
When passing parameters at the same time, the question is how to pass this o to the PHP page?
I don't know if it is feasible to use form? Is there a common method recommendation?
------ Solution --------------------
Refer:
Http://stackoverflow.com/questions/2367979/pass-post-data-with-window-location-href
POST is not allowed.
Only by setting parameters to window. location. href URL is equivalent to GET, but GET has a limit on the number of words, which makes the URL ugly.
Of course, there is another way to use cookies. However, cookies have many legal restrictions in many countries.
------ Solution --------------------
Reference:
Why can't I post? I think POST is pretty good.
I can't explain it clearly, so I referenced stackoverflow's Q & A, which is a global Q & A forum with experts like cloud.