Server Variable Help

Results 1 to 2 of 2

Thread: Server Variable Help

  1. #1
    Tim G Guest

    Default Server Variable Help

    Hey All,<BR><BR>I am in need of an example on how to use the request.servervariables("path_info"). What I want to do is have a script split up the output into hyperlinks. The final output would look something like this:<BR>Home=&#062;Products=&#062;Region<BR>Each of the strings before the &#039=&#062;&#039 would be a hyperlink. It displays your current location in relation to the root directory. You can view the same thing when browsing Yahoo!. If you can supply me with an example that would work the best for me.<BR><BR>Thanks,<BR><BR>Tim

  2. #2
    Join Date
    Dec 1969

    Default Graphical server directory levels

    &nbsp;<BR>Try the code below.<BR><BR>I arbitrarily tacked on "/default.html" to each directory level. You could make that "/index.asp" or "/default.asp" or whatever you wished. Or just leave it off if you have properly set up a default directory in each level.<BR><BR>I might point out that sites such as **** that show this same kind of "category levels" display do *NOT* base it on the directory structure. Instead, they are basing it on levels of product categories in their database. I think this is far the superior system, but I gave you what you asked for.<BR><BR>********************<BR><BR>&LT;HTML&# 062;&LT;BODY&#062;<BR><BR>&LT;FONT Size="+2" Color=Red&#062;Select level <BR>&LT;%<BR>fullPath = Request.ServerVariables("path_info")<BR>paths = Split(fullPath,"/")<BR><BR>outpath = ""<BR>separator = "&nbsp;&nbsp;"<BR>For pnum = 0 To UBound(paths)-1 &#039 don&#039t get asp file name!<BR>&nbsp;&nbsp;&nbsp;&nbsp;curPath = Trim(paths(pnum))<BR>&nbsp;&nbsp;&nbsp;&nbsp;If Len(curPath) &#062; 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;outpath = outpath & "/" & curPath<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;Response.Write separator & "&LT;A Style=&#039text-decoration:none;&#039 " <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;Response.Write "HREF=&#039" & outpath & "/default.html" & "&#039&#062;"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;Response.Write curPath & "&LT;/A&#062;" & vbNewLine<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;separator = "&nbsp;&GT;&GT;&nbsp;"<BR>&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>next<BR>%&#062;<BR><BR>&LT;/BODY&#062;&LT;/HTML&#062;<BR><BR>

Posting Permissions

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