Recommended: A brief discussion on the principle of ASP acquisition program The main steps of the collection program are as follows: 1. Obtain the content of the collected page 2. Extract all the data from the acquisition code 1. Obtain the content of the collected page I currently know about ASP commonly used methods for obtaining the collected page: 1.
User login verification script, Chkpwd.asp
The following is the quoted content:
<%
'=========User login verification script========
'If the Passed object has not been defined, it is defined as false, indicating that it has not passed the verification
If IsEmpty(Session(Passed)) Then
Session(Passed)=false
End If
'Session(Passed)=False, which means that the verification information passed from the form has not been passed yet.
If Session(Passed)=False Then
UserName=Request.Form(UserName)
UserPwd=Request.Form(UserPwd)
If UserName= Then
Errmsg=Tip: Please enter your username and password
Else
'===================================================
Set Conn= Server.CreateObject(ADODB.Connection)
Conn.Connectionstring= Driver={SQL Server};Server=192.168.1.3;UID=sa;PWD=;Database=zcmrs
Conn.open
'============================ Read user data from table log=========================
'Define RecordSet object
Set rs=Server.CreateObject(ADODB.Recordset)
'Set ConnectionString of Connection object
Set rs.ActiveConnection=Conn
'Set cursor type
rs.CursorType=3
'Open record set
rs.Open Select username,password from erpuser Where username='&UserName&'
'===================================================
If rs.EOF Then
Errmsg=Tip: The user does not exist or the password is wrong
Else
If UserPwd<>rs.Fields(password) Then
Errmsg=Tip: Login failed! Password error?
Else 'Login successfully
Errmsg=
Session(Passed)=True
Session(UserName)=rs.Fields(username)
'Identify user permissions Session(UserID)=rs.Fields(UserID)
End If
End If
End If
End If
'After login failing, the login form will be drawn
If Not Session(Passed)=True Then
%>
<html>
<head><title>Unt titled document</title>
<style type=text/css>
<!--
.STYLE1 {font-size: 12px;font-weight:bold;margin-left:120px;outline:double}
-->
</style>
<style type=text/css>
<!--
.STYLE2 {font-size: 12px;font-weight:bold;outline:double;color:#FF3333}
-->
</style>
</head>
<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 bgcolor=#000000>
<div id=parent style=height:300;width:450;border-style:solid;border-color:#FFFFF;margin-top:80px;margin-left:25%;margin-right:25%;background-color:#FFFFF>
<div id=denglu style=font-size:12px;font-weight:bold;background-color:#0099FF;text-align:center;height:40px;><br>ERP system login</div>
<form action=<%=request.ServerVariables(path_info)%> method=post name=MyForm id=MyForm>
<p class=STYLE1>Username:<input name=UserName type=text id=UserName size=18 maxlength=20>
</p>
<p class=STYLE1> Password: <input name=UserPwd type=password id=UserPwd size=18 maxlength=20>
</p>
<p align=center class=STYLE2><%=Errmsg%> </p>
<p>
<input type=submit align=middle name=Submit value=Login to system>
<input name=rege type=button align=middle onClick=location='register.asp' id=rege value=register user>
</p>
</form>
</div>
</body>
</html>
<%
'<p class=STYLE1>Verification code:<input name=CheckCode type=text id=CheckCode size=6 maxlength=4>
'<IMG style=MARGIN-RIGHT: 40px alt= src=common/getcode.asp></p>
response.End
End If
%>
Page to visit erp.asp
<The following are the quoted contents:
<!--#include file=chkpwd.asp-->
<body>
<div style='font-size:12px;font-weight:bold;border:1px solid #001;padding:4px;background:#FFCCFF;margin-top:0;'>Welcome to use the ERP query system, the current logged-in user is:
<%
If Session(Passed)=True Then
Response.Write(Session(UserName))
End If
%><a href=logout.asp>Exit the system</a>
</div>
</body>
Every time you open erp.asp, you first execute Chkpwd.asp(), which can effectively prevent unauthorized users from accessing the specified web page.
Logout.asp system exit
<body>
<%
Session(Passed)=false
Session(UserName)=
Response.Redirect(index.asp)
%>
</body>
Submit form using pictures
The following is the quoted content:
<form name=form1 method=post action=>
<td align=right><input type=image method=submit name=submit src=image/loginin.gif width=70 height=21 alt=submit></td>
</form>
Share: ASP and ACCESS link This article illustrates two ways of linking ASP and ACCESS in ASP examples. The following is the referenced content: %dim dd,connstrdd=data.mdbconnstr=&q