Believe that there is a personal homepage of netizens, is not very interested to know how visitors evaluate their work, so as to give themselves a direction of improvement, the following online survey is one example:
You need to support the FSO space, just two files, one is the processing of the page poll.asp, there is a data file Poll.txt, of course, there is a page to show the submission of the form, the following are given the code:
1. Poll.asp:
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Site Survey </title>
<link href= "News1.css" rel= "stylesheet" type= "Text/css" >
<body>
<p>
<%
Dim polled,total
Dim Pollper (4)
Dim Pollname (7)
Dim Pollnum (4)
Polled=cint (Request.Form ("select"))
Set fs= Server.CreateObject ("Scripting.FileSystemObject")
Poll=server. MapPath ("Poll.txt")
Set Textar=fs.opentextfile (poll,1,0,0)
If not session (polled) then
I=0
While not Textar.atendofstream
Getdata=textar.readline
Pollname (i) =left (RTrim (GetData), 7)
Pollnum (i) =right (RTrim (GetData), 4)
If I=polled Then
J=cdbl (Pollnum (i)) +1
Pollnum (i) =right (space (6) &trim (CStr (j)), 7)
End If
I=i+1
Wend
Textar.close
Set Textar1=fs.createtextfile (poll,-1,0)
Totle=0
For J=0 to (I-1)
Total=total+cdbl (Pollnum (j))
Textar1.writeline Pollname (j) &pollnum (j)
Next
Textar1.close
%>
<span class= "News1" > Where do you think this site needs improvement? </span></p>
<%
For J=0 to (I-1)
Pollper (j) =cdbl (Pollnum (j))/total
Width=500*pollper (j)
%>
<table width= "750" border= "0" align= "left" >
<tr>
<TD align= "left" bgcolor= "#CCCCCC" >
<%response.write (Trim (Pollname (j)) & "(")
Response.Write (FormatNumber (Pollnum (j), 0) & ")"
Response.Write ("<br>")
Response.Write ("Response.Write (width& "' height=10>")
Response.Write (FormatPercent (Pollper (j)) & "<p>")
Next
Response.Write ("Total:")
Response.Write (FormatNumber (total,0))
%>
</td>
</tr>
</table>
<%
Session (polled) =true
Else
Response.Write ("You have already voted, thank you for your vote!") ")
End If
%>
<p> </p>
</body>
2.poll.txt:
Page Art 27
Coverage of content 35
Update speed of content 43
Site visits 53
The page you want to display (form):
<table width= "100%" height= "215" border= "0" bordercolor= "#FFFFFF" background= "%20" >
<tr>
<TD height= "align=" "Center" background= "Http://www.163design.net/a/y/images/bg1.gif" class= "1" > Where do you think the site needs improvement? </td>
</tr>
<tr>
<TD height= "bgcolor=" "#FFFFFF" class= "1" > <input name= "select" type= "Radio" value= "0" checked>
The art of the page </td>
</tr>
<tr>
<TD height= "background=" "bgcolor=" #FFFFFF "class=" 1 ">
<input type= "Radio" name= "select" value= "1" >
Content Coverage </td>
</tr>
<tr>
<TD height= "bgcolor=" "#FFFFFF" class= "1" > <input type= "Radio" name= "select" value= "2" >
Update speed of content </td>
</tr>
<tr>
<TD height= "background=" "bgcolor=" #FFFFFF "class=" 1 ">
<input type= "Radio" name= "select" value= "3" >
Site visits </td>
</tr>
<tr>
<TD height= "align=" center "bgcolor=" #FFFFFF &qu