
ASP
|
| Posted: 08/30/2004, 6:17 AM |
|
Anybody have any idea,
How to display IP address, UserName and ComputerName in ASP page?
Thanks and regards,
|
|
|
 |
Joe
|
| Posted: 08/30/2004, 6:42 AM |
|
You want to creat ea label and in the default value insert these:
IP ADDRESS: Request.ServerVariables("REMOTE_HOST")
USERNAME: Request.ServerVariables("LOGON_USER")
and you can get the rest of the server variables at this website: http://www.w3schools.com/asp/coll_servervariables.asp
|
|
|
 |
Oper
Posts: 1195
|
| Posted: 09/02/2004, 7:28 AM |
|
try this:
<%
For Each name In Request.ServerVariables
Response.write("<b>"&name&"< ;/b>: ")
Response.write(Request.ServerVariables(name) + "<br>")
Next
%>
will display all server variables and name of variable.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
tulnetdotcom
Posts: 26
|
| Posted: 09/13/2004, 3:24 AM |
|
By creating label and in the default value inserted these:
IP ADDRESS: Request.ServerVariables("REMOTE_HOST")
USERNAME: Request.ServerVariables("LOGON_USER")
But its giving me error while loading the pages.
How to do it in codecharge?
|
 |
 |
peterr
Posts: 5971
|
| Posted: 09/13/2004, 9:18 AM |
|
Please always post error messages so that we don't need to guess what is the problem.
I think that you need change single quotes to double quotes in this case since what you entered is a string that will be assigned to a variable.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
valkr1e
Posts: 12
|
| Posted: 10/17/2004, 2:26 PM |
|
I'm attempting to troubleshoot the tutorial code for logging IP Address and Date Info into the database, and also trying to pass login info into forms(creating a forums/blogging application), and came across this thread to display these variables, could not get oper's code to work at all, and the other code works for IP, but not username, usinf application wizard built pages for the moment while i try to figure out the names of these variable and how to access and manipulate them(havent coded much in the past 5 years, outside of basic html) the error i get from oper's code is that the variable "name" isn't known/declared. the other code gives no error message, displays IP and not Username. any ideas? a list of common variables like this would be very useful.
|
 |
 |
valkr1e
Posts: 12
|
| Posted: 10/17/2004, 2:50 PM |
|
found a substitue for oper's code, however, i still appear to not be getting the logon info passed, i autogenerate the sire from a SQL database, with asp, and then change a the returnpage to vars.asp, which contains a table base equivalent to display all server variables, however, remote_user, Logon_user, and auth_user are all blank, is the user info stored in a proprietary variable?
|
 |
 |
CameronF
Posts: 23
|
| Posted: 12/30/2004, 5:47 PM |
|
If you want to get the computer name and from IIS you have to turn on name resolution within the metabase.
see the below:
http://support.microsoft.com/default.aspx?scid=kb;en-us;245574
|
 |
 |
|

|
|
|
|