ASP advanced article Online Management Update (v)

Source: Internet
Author: User
Tags date
Online ASP Advanced article online Management Update--The article shows the article

Author: Beach Boy

The previous article has been introduced to save the articles, and then you should talk about the display of the article. Here, you can see the simple ease of use of ASP, only through a file, you can display all the articles in the database. It opens the records specified in the database and specifies the content that is required for the display, primarily through the article number (ArticleID) returned from the connection and the column information (typeid).

The following is the detailed code and annotations for the article Display page (list.asp):

The Open database connection
<!--#include file= "conn.asp"-->
<%
The Define Variable
Dim sql
Dim rs
Dim typename
Dim typeid
Dim rstype,typesql
"Accept the returned column information and open the specified column recordset type
Typeid=request ("typeID")
Set Rstype=server.createobject ("Adodb.recordset")
Typesql= "SELECT * from type where typeid=" &cstr (typeid)
Rstype.open typesql,conn,1,1
"Invokes the specified column name and assigns its information to the TypeName
Typename=rstype ("type")
"Close the recordset
Rstype.close
%>
Pioneer |http://asky.on.net.cn</title> of <title>asp Dynamic Network
<link rel= "stylesheet" href= "Style.css" >

<body>
<div align= "center" ><center>

<table border= "1" width= "97%" cellspacing= "0" cellpadding= "0" bordercolorlight= "#000000"
bordercolordark= "#FFFFFF" >
<tr>
&LT;TD width= "100%" bgcolor= "#D0D0D0" ><p align= "center" >
"Show Column information
Column:<%=typename&%>
<%
"Opens the specified recordset article and opens the specified article number with the returned article number ID, showing the article number, date of entry, number of views, article title, and article content.
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from Artidle where articleid=" &request ("id")
Rs.Open sql,conn,1,1
%>
----article number: <%=rs ("ArticleID")%>----Date Added: <%=rs ("date")%>----Views: <%=rs ("hits")%></td>
</tr>
<tr>
&LT;TD width= "100%" ><p align= "right" ><a href= "Javascript:self.close ()" > "Close Window" </a></td>
</tr>
<tr>
&LT;TD width= "100%" ><p align= "center" ><b><%=rs ("title")%></b></td>
</tr>
<tr>
&LT;TD width= "100%" >
<blockquote>
<br>
<%=rs ("content")%> <br>
<br>
<p align=center>
"Here is the article email forwarding, through a section of Sentemail program to achieve, the following will introduce
<form method=post action= ' Sentemail.asp?id=<%=rs ("ArticleID")%> ' >
<b> send articles to email </b><br>
<input type= ' text ' name= ' email ' maxlength=20 class=smallinput>
<input class=buttonface type= ' submit ' value= ' send ' name= ' send ' >
</form>
</blockquote>
</td>
</tr>
</table>
</center></div>
</body>
<%
"Turn off recordset and database connections
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
%>

The above is the article display program, here with a very small number of code to achieve from the database call to specify the content of the article and display the process, I believe that you can appreciate the function of ASP, in this section mentioned the use of ASP online to send articles to the mailbox program, So below I will introduce to you about the article forwarding mailbox Function!

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.