使用asp尽量减少服务器端的工作量,这样就应该多使用javascript,把所有提交字段使用javascript或vbscript检测后提交给服务器,这样服务器就不必再作检测,而在提交时可能会有人修改script从本地提交,这样存在安全提交的问题,所以应该要求从服务器断路径提交,其他地址提交提交无无效:
1
2server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
3server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
4if mid(server_v1,8,len(server_v2))<>server_v2 then
5response.write "
<br/>
<br/>
<center><table bgcolor="#EEEEEE" border="1" bordercolor="black" cellpadding="20" width="450">"
response.write "<tr><td style="font:9pt Verdana">"
response.write "你提交的路径有误,禁止从站点外部提交数据请不要乱该参数!"
response.write "</td></tr></table></center>
1"
2response.end
3end if