Getting GET or POST variables using JavaScript

I have something that runs on a server with no PHP or any of those widgets.

A user submits a form with 6 fields. Clicks “Go”. A page appears that displays what he just entered, with a form of his data in hidden fields, and a link with document.form.submit() that takes you to a CGI program. It must be 2 different page loads.

Is displaying what he entered in the form in the next page possible with JavaScript? If so, what are the JS variables that would let me access that data?


The server may not have PHP, but CGI (Perl) is what is getting the form’s POST variables.
I know of no way for javascript alone to get and display POST variables that where sent to it’s page.
However, javascript can parse GET variables out of the location object if you don’t mind having everything visible in the URL and aren’t worried about security issues.
Or you could use javascript to display the entered information before the form is submitted. Something like a “You entered the following information. Are you sure you want to submit it?” type of thing.

If you use GET then Javascript can read the values that are passed using

See for more info on how to do it.

Javascript has no access if you use POST

Nice article, I came up with a similar method today. Came across this page on google, just thought i would share it: