I believe that netizens who have personal homepages would like to know how visitors evaluate their works, so as to give themselves a direction for improvement.
The following online survey is one example:)
You need a space that supports FSO. You only need two files, one is the processing page poll.asp, the other is the data file poll.txt, and of course the other one is to display the submission form. page, the codes are given below:
1. poll.asp:
< %@LANGUAGE="VBSCRIPT " CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Site Survey</title>
<link href="news1.css" rel="stylesheet" type="text/css">
</head>
<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("<img src='images/bg1.gif' width=")
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>
</html>
2.poll.txt:
Page art 27
Content coverage 35
Content update speed 43
The number of visits to the website is 53.
The page (form) you want to display:
<table width="100%" height="215" border="0" bordercolor="#FFFFFF" background="%20">
<tr>
<td height="20" align="center" background="images/bg1.gif" class="1">What areas do you think need improvement on this site? </td>
</tr>
<tr>
<td height="20" bgcolor="#FFFFFF" class="1"> <input name="select" type="radio" value="0" checked>
Page art</td>
</tr>
<tr>
<td height="20" background=" " bgcolor="#FFFFFF" class="1">
Content coverage</td>
</tr>
<tr>
<td height="20" bgcolor="#FFFFFF" class="1"> <input type="radio" name="select" value="2">
Content update speed</td>
</tr>
<tr>
<td height="20" background=" " bgcolor="#FFFFFF" class="1">
<input type="radio" name="select" value="3">
Website visits</td>
</tr>
<tr>
<td height="66" align="center" bgcolor="#FFFFFF"><span class="1">
<input type="submit" name="Submit2" value="Submit">
</span><a href="poll.asp">View</a></td>
</tr>
</table>
Isn’t it very simple? Hurry up and make one yourself :)