How to access Javascript Gobal Variable into CGI Program
Thanks ,
Chells
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Three ways: POST, GET, or cookies. which you use depends on your situation.
POST: Include a form on your page with two hidden fields. When an event occurs, fill the hidden fields with your JS variables and submit the form to your cgi program.
GET: Have JS tack the variables onto the URL. when the user clicks a link, it activates a JS function. the JS function sends the browser to “cgi-prog.cgi?JSvar1=foo&JSvar2=bar”
cookies: JS sets a cookie on the user’s machine once it has determined the variables. Perl reads that cookie to get the variables.