1. How to use ASP to determine the virtual physical path of your website
A: Use the mappath method.
<P align = "center"> <font size = "4" face = "Arial"> <B>
The physical path to this virtual website is:
</B> </font>
<Font color = "# ff0000" size = "6" face = "Arial">
<% = Server. mappath ("/") %>
</Font> </P>
2. How do I know the browser used by the user?
A: Use the request object method.
Strbrowser = request. servervariables ("http_user_agent ")
If instr (strbrowser, "MSIE") <> 0 then
Response. Redirect ("formsieonly.htm ")
Else
Response. Redirect ("forall.htm ")
End if
3. How to calculate the average number of repeated visits per day
Answer: Solution
<% Startdate = datediff ("D", now, "01/01/1990 ")
If strdate <0 then startdate = startdate *-1
Avgvpd = int (usercnt)/startdate) %>
Display result
<% Response. Write (avgvpd) %>
That is it. This page have been viewed since November 10, 1998
4. How to display random images
A:
<% Dim P, PPIC, dpic
PPIC = 12
Randomize
P = int (PPIC * RND) + 1)
Dpic = "Graphix/randompics/" & P & ". GIF"
%>
Display
5. How to return to the previous page
A:
<A href = "<% = request. servervariables (" http_referer ") %>"> preivous page </a>
Or use an image, such: