Recommended: ASP prevents GET, Post injection and server attacks, and records IP % 'Prevent GET, Post injection and server attack' Use method to include this file in the file that needs to be noted, so please note that post attacks and Get attacks here are not necessarily attacks. Please pay attention to using them in the English version' Feng Xu modified session.Abandon() Dim fxjt111_Attack_post,fxjt111_Attack_Get,fxjt111_Attack_Sys
Due to working relationships, we are working on a user space. To use the most recent visitors of the space, see the ASP code:
<%
username=request.QueryString(username) 'The username in the ground column is your username
if trim(request.Cookies(user_name))<> Then 'Home page needs to determine whether the access is logged in, only logged in can be recorded in the database.
if username <> request.Cookies(user_name) Then 'Just determine whether the visitor is himself
f_username=trim(request.Cookies(user_name)) 'Get accessed username
f_time=now()
Call Visitor() 'Call accessed function
end if
end if
Sub Visitor()
'Author: Ruthless Source:
sqlVisitor=(select top 1 * from visitor where (username='&username&') and (f_username='&f_username&') )
Set rsVisitor=server.CreateObject(adodb.recordset)
rsVisitor.open sqlVisitor,conn,1,1
If not (rsVisitor.eof and rsVisitor.bof) Then 'Just determine whether a database exists. If there is an update time, insert the username and time of the visitor in year
conn.execute (update visitor set f_time ='&now()&' where (username='&username&') and (f_username='&f_username&') )
Else
conn.execute (insert into visitor (username,f_username,f_time) values ('&username&','&f_username&','&f_time&'))
end If
rsVisitor.close()
Set rsVisitor=nothing
End Sub
%>
Then I call the latest access in the space and the code is omitted.
Share: ASP replaces the last bit of IP address with the asterisk instance code First save the IP address into the database, and then take it out. The effect is as shown in the figure: The code is as follows: % 'Source ipstr= rs(cIP) ipstr=split(ipstr,.,-1,1) ipstrout=ipstr(0).ipstr(1).ipstr(2).* response.write ipstrout %