Recommended: Asp three-level linkage drop-down menu database version (including source program) % OptionExplicit 'Database: 'location 'City table where the loaction is located' field'loactionid (primary key) 'loactionname name' County table where the district is located' field'locationid (primary key) 'districtid 'districtname 'Table 3 village' field' directory (primary key)
1. How to use Asp to determine the virtual physical path of your website
Answer: 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 the user is using?
Answer: 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) %>
Show results
<% response.write(avgvpd) %>
that is it.this page have been viewed since November 10,1998
Share: A method to prevent messages from being flooded (randomly generated 4-digit authentication code) Principle: When each time you submit a message, you must enter a randomly generated 4-digit authentication code. The following code is used to generate a random 4-digit number in ASP: % dim key randomize timer key=Int((8999)*Rnd +1000) % Displayed in the form: Authentication code: %=key% input type=text name=rekey size=8 maxlength=4 input value=%=key
2 pages in total Previous page 12 Next page