简体   繁体   中英

read values from form post in jquery or javascript

i have a form which when submitted goes to login page of another site and After the authentication is verified, the user is redirected back to my site and i receive from post values of: TOKEN and Address information.

I want to get the TOKEN and address information sent in post on the page to which i am redirected after login. How can i get those values through jquery or javascript.

The POST values are not available to jQuery or Javascript, because the server does not send them back to the client after the form is submitted. You need to echo them in your page using a server-side code, for example in PHP :

var $_POST = <?php echo json_encode($_POST); ?>;

Then you'll be able to use $_POST.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM