<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% ' Project Name: Simple Blog ' Version: 1.1 ' Author: James Tang ' Email: fwsous@gmail.com ' Web site: www.fwso.cn ' Copyright (C) 2008 James Tang. All Rights Reserved. ' ' Note: This program can be used for any purpose for free. ' %> <% If Request.QueryString("article_id") = "" then Response.Redirect(Application("blogURL")) End if %> <% 'Read data from database Dim articleRs, articleSQL, articleID, articleTitle articleID = Request.QueryString("article_id") articleSQL = "SELECT article_title,article_date,article_content, user_name, cat_name FROM articles AS a, users AS u, categories AS c WHERE a.user_id=u.user_id AND a.cat_id=c.cat_id AND a.article_id=" & articleID Set articleRs = Server.CreateObject("ADODB.Recordset") articleRs.open articleSQL, conn, 1,1 If articleRs.EOF or articleRs.BOF then '#If-Else-1 articleTitle = "Article Not Exists" Else articleTitle = articleRS("article_title") End If %> <%=articleTitle%> " />
<% If articleRs.EOF or articleRs.BOF then '#If-Else-1 Response.Write("The article you required does not exists.") Else %>
<%=articleRs("user_name")%> | <%=convertDatetime(articleRs("article_date"))%> | <%=articleRs("cat_name")%>
<%'=encodeHTML(articleRs("article_content"))%> <%=articleRs("article_content")%>
<% End If 'End #If-Else-1 articleRs.close Set articleRs = nothing conn.close Set conn = nothing %>