ASP advanced article online Management Update (eight)

Source: Internet
Author: User
Tags trim
Online ASP Advanced article online Management Update--Manager login and validation Chapter

Author: Beach Boy

The front program of the article Management system has been introduced, the main front of the program is to provide you with browsing the page, mainly the article browsing, article search, forwarding emails and other programs, in fact, the introduction of the article to add and save is actually the background of the system program, but the specific content of the article is and the collection of articles, Add, save is inseparable, otherwise how to show the article? We are beginning to introduce the article Management system background program will have the following features: admin login verification, the article online add (previously introduced), the article online modification Delete, admin password modification, article column modify add and delete and other main functions, the following we will be from the system administrator login and verification began step-by-step story.

Now the general login program is to have an input administrator name, Password page and a validation page, so that even if you know the landing page can not know the content of the verification page, of course, our password is not on the verification page, but in the database, the actual meaning of this procedure is not very big, But since you know the process, it is necessary to do so in the absence of any other database.

OK, let's start with the introduction of the program, first I briefly introduce the landing page Login.asp, this page is very simple, so I will simply introduce:

<title> Manager Login </title>
<link rel= "stylesheet" href= "style. CSS ">
<body>
<div align= "center" ><center>

<table border= "0" cellspacing= "1" width= "90%" >
<tr>
<td> <form method= "POST" action= "chklogin.asp" >
<table width= "45%" border= "1" cellspacing= "0" cellpadding= "1" align= "center"
bordercolordark= "#ecf5ff" bordercolorlight= "#6699cc" >
<tr>
<td><table width= "100%" border= "0" cellspacing= "1" cellpadding= "1" >
<tr>
"Assign the user name entered from the page to username and the password to password
&LT;TD width= "33%" align= "right" height= "a" > Username:</td>
&LT;TD width= "67%" ><input name= "username" maxlength= "" class= "Smallinput" size= "> </td>
</tr>
<tr>
&LT;TD width= "33%" align= "right" height= "a" > Password:</td>
&LT;TD width= "67%" ><input type= "password" name= "password" maxlength= "class="
Size= "> </td>"
</tr>
<tr>
&LT;TD colspan= "2" height= "></td>"
</tr>
</table>
</td>
</tr>
&LT;TR align= "center" >
&LT;TD height= ">"
<input type= "Submit" name= "Submit" value= "OK" class= "ButtonFace" >

<input type= "reset" name= "Submit2" value= "rewrite" class= "ButtonFace" >
</td>
</tr>
</table>
</form>
<p align= "center" > </td>
</tr>
</table>
</center></div>
</body>

The above program is very simple, are the HTM structure, I do not say more, the following I talk about verifying user names and Passwords page chklogin.asp

"Open and establish a database connection
<!--#include file=conn.asp-->
<%
Dim sql
Dim rs
Dim founduser
Dim username
Dim password
Dim errmsg
Dim Founderr
Founderr=false
Founduser=false
"Accept the user information returned from Login.asp Username,password
Username=trim (Request.Form ("username"))
Password=trim (Request.Form ("password"))
"If username username and password password are null, return Login.asp page
If Username= "" Then
Response.Redirect "Login.asp"
End If
If password= "" Then
Response.Redirect "Login.asp"
End If
"Use username to open records specified in Recordset admin
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from admin where username= '" &username& ""
Rs.Open sql,conn,1,1
If not rs.eof then
"If the password returned in the specified record is password and the password in the database is equal, the page is directed to the admin page manage.asp, where the Response.Cookies (" Adminok ") is =true when the user is right. Confirm a cookie so you can enter the Admin page next time without landing
If Password=rs ("password") then
Response.Cookies ("Adminok") =true
Response.Redirect "Manage.asp"
Else
"If the password is incorrect, the page is directed to the landing page Login.asp
Response.Redirect "Login.asp"
End If
Else
Response.Redirect "Login.asp"
End If
"Close the database connection
Rs.close
Conn.close
Set rs=nothing
Set conn=nothing
%>

After the password verification has entered the article Management System Management homepage, the next section of the content is to manage the main structure and function of the page.

Reprint please indicate the source http://asky.on.net.cn



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.