Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win env. variable sent by a Form ?

Status
Not open for further replies.

lgnihlman

MIS
Dec 5, 2002
89
0
0
SE
Hi !
I have a form that users use to e-mail me a problem report.
I would like to have the Windows environment variable COMPUTERNAME included in the e-mail.
The variable should not be visible to users, only to me.

Is there a way to accomplish this ?

Any tips are appreciated,thanks.

Regards
Lars-Gunnar

 
i think you should get to that result using Request.ServerVariables ("REMOTE_HOST"), when the mail is sent just include an hidden field to get the computer's name.

Hope this helps

Herminio, Portugal
 
Since I'm a novice when it comes to codeing I wonder if
you could give some example of how this code could
look like.

Thanks
Lars-Gunnar
 
On your page which sends the email, get the host name into a variable like this:

Code:
strHost = Request.ServerVariables("REMOTE_HOST")

Then add it into the email along with your existing stuff from the form.

NB: You may well find the computer name is not available, in which case you may just get their IP address returned. You also might need to use REMOTE_ADDR to get the IP address if REMOTE_HOST is blank. Try it and see what you get! --James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top