Recommended: ASP generates HTM static list paging (including code, tested successfully) !--#include file=conn.asp-- htmlheadTITLE paging test/TITLELINK href=inc/style.css type=text/css rel=stylesheet/head %strHead=strHeadhtml strHead=strHeadhead strHead=strHeadTITLE paging test/TITLE strHead= strHeadLINK href=inc/style.cs
Principle: Each time you submit a message, you must enter a randomly generated 4-digit authentication code.
The following code is used in ASP
Generate random 4-digit numbers:
<%
dim key
randomize timer
key=Int((8999)*Rnd +1000)
%>
Display in the form:
Authentication code: <%=key%>
<input type=text name=rekey size=8 maxlength=4>
<input value=<%=key%> type=hidden name=key>
Check after form submission:
key=Request.Form(key)
rekey=Request.Form(rekey)
if rekey<>key then
Response.Write(<script language=javascript>alert('Please enter the correct authentication code!');history.back()</script>)
response.End()
end if
Share: Interpretation of the problem of preventing injection attacks when ASP programs execute SQL statements The following is a simple code for a user to change their password--------------------- username=request(user_name) pwd=request(pwd) username=replace(username,' ,'') pwd=replace(pwd,','') sql=updatetbl_testsetpwd='pwd'whereuid='username' setrs=