dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: JavaScript
Expertise: Beginner
Nov 3, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Access CGI Environment Variables

Question:
Can JavaScript access CGI environment variables? Once a user has logged into my site, I would like to retrieve the user name from the "REMOTE_USER" variable.

Answer:
No, there is no straightforward way to make this happen because JavaScript runs within your browser on the client, whereas CGI scripts (and environment variables) are on the server. The only way to accomplish what you're after is to use your CGI script to dynamically output the values of the CGI variables you're interested in when creating your HTML page. You can use CGI to save the environment variables into hidden form variables or even generate client-side JavaScript dynamically. But, either way, this is not quick and easy.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date