location href

Results 1 to 5 of 5

Thread: location href

  1. #1
    john doe Guest

    Default location href

    when my asp page loads - how i do i get the acual url that is in the address bar - like i can get from js:<BR>location.href.<BR>or:<BR>how can i transfer js var to asp...<BR>please,<BR>bye.

  2. #2
    geeoff Guest

    Default RE: location href

    Well, you could write the equivalent code in VBScript.......<BR><BR>Request.ServerVariables("HT TP_REFERER")<BR><BR>-geeoff

  3. #3
    john doe Guest

    Default RE: location href

    are you sure it is that?!<BR>it doesn&#039t seem to work...<BR>but thanks anyway...

  4. #4
    geeoff Guest

    Default RE: location href

    Here is the MSDN documentation on the ServerVariables method.......<BR><BR>HTH more.....<BR><BR><BR>ServerVariables<BR>This is preliminary documentation for IIS 5.0 and is subject to change. <BR>The ServerVariables collection retrieves the values of predetermined environment variables.<BR><BR>Syntax<BR>Request.ServerVariable s (server environment variable)<BR><BR> <BR><BR>Parameters<BR>server environment variable <BR>Specifies the name of the server environment variable to retrieve. It can be one of the following values. Variable Description <BR>ALL_HTTP All HTTP headers sent by the client. <BR>ALL_RAW Retrieves all headers in raw form. The difference between ALL_RAW and ALL_HTTP is that ALL_HTTP places an HTTP_ prefix before the header name and the header name is always capitalized. In ALL_RAW the header name and values appear as they are sent by the client. <BR>APPL_MD_PATH Retrieves the metabase path for the Application for the ISAPI DLL. <BR>APPL_PHYSICAL_PATH Retrieves the physical path corresponding to the metabase path. IIS converts the APPL_MD_PATH to the physical (directory) path to return this value. <BR>AUTH_PASSWORD The value entered in the client&#039s authentication dialog. This variable is available only if Basic authentication is used. <BR>AUTH_TYPE The authentication method that the server uses to validate users when they attempt to access a protected script. <BR>AUTH_USER Raw authenticated user name. <BR>CERT_COOKIE Unique ID for client certificate, returned as a string. Can be used as a signature for the whole client certificate. <BR>CERT_FLAGS bit0 is set to 1 if the client certificate is present. <BR>bit1 is set to 1 if the cCertification authority of the client certificate is invalid (it is not in the list of recognized CAs on the server).<BR> <BR>CERT_ISSUER Issuer field of the client certificate (O=MS, OU=IAS, CN=user name, C=USA). <BR>CERT_KEYSIZE Number of bits in Secure Sockets Layer connection key size. For example, 128. <BR>CERT_SECRETKEYSIZE Number of bits in server certificate private key. For example, 1024. <BR>CERT_SERIALNUMBER Serial number field of the client certificate. <BR>CERT_SERVER_ISSUER Issuer field of the server certificate. <BR>CERT_SERVER_SUBJECT Subject field of the server certificate. <BR>CERT_SUBJECT Subject field of the client certificate. <BR>CONTENT_LENGTH The length of the content as given by the client. <BR>CONTENT_TYPE The data type of the content. Used with queries that have attached information, such as the HTTP queries GET, POST, and PUT. <BR>GATEWAY_INTERFACE The revision of the CGI specification used by the server. The format is CGI/revision. <BR>HTTP_&#060;HeaderName&#062; The value stored in the header HeaderName. Any header other than those listed in this table must be prefixed by HTTP_ in order for the ServerVariables collection to retrieve its value. <BR>Note The server interprets any underscore (_) characters in HeaderName as dashes in the actual header. For example if you specify HTTP_MY_HEADER, the server searches for a header sent as MY-HEADER.<BR> <BR>HTTP_ACCEPT Returns the value of the Accept header. <BR>HTTP_ACCEPT_LANGUAGE Returns a string describing the language to use for displaying content. <BR>HTTP_USER_AGENT Returns a string describing the browser that sent the request. <BR>HTTP_COOKIE Returns the cookie string that was included with the request. <BR>HTTP_REFERER Returns a string containing the URL of the original request when a redirect has occurred. <BR>HTTPS Returns ON if the request came in through secure channel (SSL) or it returns OFF if the request is for a non-secure channel. <BR>HTTPS_KEYSIZE Number of bits in Secure Sockets Layer connection key size. For example, 128. <BR>HTTPS_SECRETKEYSIZE Number of bits in server certificate private key. For example, 1024. <BR>HTTPS_SERVER_ISSUER Issuer field of the server certificate. <BR>HTTPS_SERVER_SUBJECT Subject field of the server certificate. <BR>INSTANCE_ID The ID for the IIS instance in textual format. If the instance ID is 1, it appears as a string. You can use this variable to retrieve the ID of the Web-server instance (in the metabase) to which the request belongs. <BR>INSTANCE_META_PATH The metabase path for the instance of IIS that responds to the request. <BR>LOCAL_ADDR Returns the Server Address on which the request came in. This is important on multihomed machines where there can be multiple IP addresses bound to the machine and you want to find out which address the request used. <BR>LOGON_USER The Windows account that the user is logged into. <BR>PATH_INFO Extra path information as given by the client. You can access scripts by using their virtual path and the PATH_INFO server variable. If this information comes from a URL, it is decoded by the server before it is passed to the CGI script. <BR>PATH_TRANSLATED A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping. <BR>QUERY_STRING Query information stored in the string following the question mark (?) in the HTTP request. <BR>REMOTE_ADDR The IP address of the remote host making the request. <BR>REMOTE_HOST The name of the host making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this empty. <BR>REMOTE_USER Unmapped user-name string sent in by the user. This is the name that is really sent by the user, as opposed to the names that are modified by any authentication filter installed on the server. <BR>REQUEST_METHOD The method used to make the request. For HTTP, this is GET, HEAD, POST, and so on. <BR>SCRIPT_NAME A virtual path to the script being executed. This is used for self-referencing URLs. <BR>SERVER_NAME The server&#039s host name, DNS alias, or IP address as it would appear in self-referencing URLs. <BR>SERVER_PORT The port number to which the request was sent. <BR>SERVER_PORT_SECURE A string that contains either 0 or 1. If the request is being handled on the secure port, then this will be 1. Otherwise, it will be 0. <BR>SERVER_PROTOCOL The name and revision of the request information protocol. The format is protocol/revision. <BR>SERVER_SOFTWARE The name and version of the server software that answers the request and runs the gateway. The format is name/version. <BR>URL Gives the base portion of the URL. <BR><BR><BR>Remarks<BR>If a client sends a header other than those specified in the preceding table, you can retrieve the value of that header by prefixing the header name with HTTP_ in the call to Request.ServerVariables. For example, if the client sent the header<BR><BR>SomeNewHeader:SomeNewValue<BR> <BR>you could retrieve SomeNewValue by using the following syntax:<BR><BR>&#060;% Request.ServerVariables("HTTP_SomeNewHeader") %&#062;<BR> <BR>You can iterate through each server variable name. For example, the following script prints out all of the server variables in a table:<BR><BR>&#060;TABLE BORDER="1"&#062;<BR>&#060;TR&#062;&#060;TD&#062;&# 060;B&#062;Server Variable&#060;/B&#062;&#060;/TD&#062;&#060;TD&#062;&#060;B&#062;Value&#060;/B&#062;&#060;/TD&#062;&#060;/TR&#062;<BR>&#060;% For Each strKey In Request.ServerVariables %&#062; <BR>&#060;TR&#062;&#060;TD&#062; &#060;%= strKey %&#062; &#060;/TD&#062;&#060;TD&#062; &#060;%= Request.ServerVariables(strKey) %&#062; &#060;/TD&#062;&#060;/TR&#062;<BR>&#060;% Next %&#062;<BR>&#060;/TABLE&#062;<BR><BR>Example<BR>The following example uses the Request object to display several server variables:<BR><BR>&#060;HTML&#062;<BR>&#060;!-- This example displays the content of several ServerVariables. --&#062; <BR>ALL_HTTP server variable = <BR>&#060;%= Request.ServerVariables("ALL_HTTP") %&#062; <BR><BR>CONTENT_LENGTH server variable = <BR>&#060;%= Request.ServerVariables("CONTENT_LENGTH") %&#062; <BR> <BR>CONTENT_TYPE server variable = <BR>&#060;%= Request.ServerVariables("CONTENT_TYPE") %&#062; <BR><BR>QUERY_STRING server variable = <BR>&#060;%= Request.ServerVariables("QUERY_STRING") %&#062; <BR> <BR>SERVER_SOFTWARE server variable = <BR>&#060;%= Request.ServerVariables("SERVER_SOFTWARE") %&#062; <BR> <BR>&#060;/HTML&#062;<BR> <BR>The next example uses the ServerVariables collection to insert the name of the server into a hyperlink. <BR><BR>&#060;A HREF = "http://&#060;%= Request.ServerVariables("SERVER_NAME") %&#062;<BR>/scripts/MyPage.asp"&#062;Link to MyPage.asp&#060;/A&#062;<BR> <BR>Applies To<BR>Request Object <BR><BR>See Also<BR>ClientCertificate, Cookies, Form, QueryString<BR><BR>--------------------------------------------------------------------------------<BR>

  5. #5
    John doe Guest

    Default ok..ok :-)

    that was nice~!<BR>i will ry again...

Posting Permissions

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