表单页面:login.asp
<form name="form1" action="check_form.asp" method="post">
<div align="center">
<p> </p>
<table width="362" height="252" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="156" valign="top" background="images/00.jpg"><table width="323" height="171" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="43" colspan="2"> </td>
</tr>
<tr>
<td width="86" height="77" valign="bottom"> 用户名;</td>
<td width="237" valign="bottom"><div align="left">
<input type="text" name="textfield2">
</div></td>
</tr>
<tr>
<td height="23"> 密 码:</td>
<td height="23"><div align="left">
<input type="text" name="textfield22">
</div></td>
</tr>
<tr>
<td height="27" colspan="2">
<div align="center">
<input type="submit" name="action2" value="提交">
<input type="reset" name="Submit" value="重置">
</div></td>
</tr>
</table></td>
</tr>
</table>
<p><br>
</p>
</div>
</form>
检测页面:check_form.asp
<%
ServerName1=Cstr(Request.ServerVariables("HTTP_REFERER"))
ServerName2=Cstr(Request.ServerVariables("SERVER_NAME"))
if Mid(ServerName1,8,len(ServerName2))<>ServerName2 then
Response.Write "禁止从网站外部提交表单!!"
end if
%>