ASP advanced article online Management Update (II)

Source: Internet
Author: User
Tags chr microsoft frontpage
Online ASP Advanced article online Management Update--Added articles

Author: Beach Boy

The previous section has introduced a database connection for article management, and this article will cover the online additions to the article. When you find a good piece of information, and want to put it on your site as soon as possible, if you first think of a quick to do a page, and quickly upload it with FTP, then here these are not necessary, Here you can enter the management page by adding articles, and then directly paste the article copied over it, which is also the focus of this article--the article online Add.

In addition, through the following step-by-step explanation, I believe you can understand the meaning of the HTM code here will not be told.

Create a new ASP file addarticle.asp with the following specific code:

"Insert database connection open File
<!--#include file= "conn.asp"-->
"This program will later be used to verify administrator information, mainly to prevent others from being able to add articles directly without password verification.
If Request.Cookies ("Adminok") = "" Then
Response.Redirect "Login.asp"
End If
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 3.0" >
<title> Create articles </title>
<link rel= "stylesheet" type= "Text/css" href= "Style.css" >


<form method= "POST" action= "savearticle.asp" >
<div align= "center" ><center><table border= "1" cellspacing= "0" width= "80%" bordercolorlight= "#000000" bordercolordark= "#FFFFFF" cellpadding= "0" >
&LT;TD width= "100%" bgcolor= "#D0D0D0" height= "M" ><div align= "center" ><center><p><b> Add text Chapter </b></td>
&LT;TR align= "center" >
&LT;TD width= "100%" ><table border= "0" cellspacing= "1" width= "100%" >
&LT;TD width= "15%" align= "right" height= "a" ><b> article title:</b></td>
&LT;TD width= "85%" height= ">"
"Enter the article title information here
<input type= "text" name= "Txttitle" size= "" class= "Smallinput" maxlength= ">"
&LT;TD width= "15%" align= "right" height= "a" ><b> article column:</b></td>
&LT;TD width= "85%" height= ">"
"Open a specified recordset with a Recordset object and select
<select class= "Smallsel" name= "typeID" size= "1" >
Dim Rs,sql,sel
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from Type"
"Set open mode is read only
Rs.Open sql,conn,1,1
"Displays all of the contents of the recordset, where the column name is displayed in the Drop-down menu, and the name of the column is selected here when the article is added.
Do as not rs.eof
Sel= "Selected"
Response.Write "<option" & Sel & "Value=" +cstr (RS ("typeID")) + "' Name=typeid>" +rs ("type") + "</option > "+CHR (10) +CHR
"Displays a record and automatically moves to the next record later.
"Close open recordsets and database connections
Set rs=nothing
&LT;TD width= "15%" align= "right" valign= "top" ><b> article content:</b></td>
&LT;TD width= "85%" >
The article content add area
<textarea rows= "name=" txtcontent "cols=" class= "Smallarea" ></textarea></td>
&LT;TD width= "15%" align= "right" valign= "top" height= "></td>"
&LT;TD width= "85%" ></td>
</center></div><div align= "center" ><center><p><input type= "Submit" value= "Add"
Name= "Cmdok" class= "ButtonFace" > <input type= "reset" value= "clear"
Name= "Cmdcancel" class= "ButtonFace" ></p>

At this point, our article to add a page to complete, added the article of course, but also to save the line, so the next section will detail the preservation of the detailed process, you can also understand in the ASP code is how to do database operations.

Reprint please indicate the source

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: 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.