Parsing a URL...

Results 1 to 2 of 2

Thread: Parsing a URL...

  1. #1
    Jason Guest

    Default Parsing a URL...

    I need help parsing a URL string...<BR><BR>What i&#039;m trying to accomplish is by using the Request.ServerVariables("SCRIPT_NAME")...<BR><BR>W hat I want to do is detect whether a users URL is showing a specific file name such as "default.asp" and eliminate it from the URL...<BR><BR>for example, if the Server Variable returns...<BR><BR>/example/parse/default.asp<BR><BR>Then<BR><BR>I want to remove "default.asp" from the string to return<BR><BR>/example/parse/<BR><BR>Any help on doing this would be great...

  2. #2
    Join Date
    Dec 1969

    Default RE: Parsing a URL...

    Try this:<BR>ar = split(request.servervariables("SCRIPT_NAME"),"/")<BR>for i = lbound(ar) to ubound(ar)-1<BR> str = str & ar(i) & "/"<BR>Next<BR>Response.Write str

Posting Permissions

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