Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    kam
    kam is offline
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Request.ServerVariables Error

    I would like to collect the host information (e.g. Logon_user,...) and pass it back to the server.

    But when I retreve the variable, it return BLANK.

    Help

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <%@ Language=VBScript %>
    <%Option Explicit%>
    <HTML>
    	<HEAD>
    		<title>Server Variables</title>
    	</HEAD>
    	<BODY>
    		<table cellpadding="1" cellspacing="0" border="1">
    			<tr>
    				<th>Item</th>
    				<th>Value</th>
    			</tr>
    		<%
    		Dim Item
    		For Each Item In Request.ServerVariables
    			Response.Write "<tr>" & vbcrlf
    			Response.Write "<td>" & Item & "</td>" & vbcrlf
    			Response.Write "<td>" & Request.ServerVariables(Item) & "</td>" & vbcrlf
    			Response.Write "</tr>" & vbcrlf
    		Next
    		%>
    		</table>
    	</BODY>
    </HTML>
    Run this on the server you are coding on and you'll get all of the server variables back plus which ones to use. If you are trying to obtain a user's id, you will need to turn annonymous access off, otherwise it will return blank.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •