<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <%Option Explicit%> <% 'Declare the variables needed Dim Page, rsPageDetails, Content 'Open the connection to the database OpenDatabase 'Set the title of the page to be read Page = "Resources" 'Read the details of the page Set rsPageDetails = DSource.Execute("SELECT * FROM [Site Content] WHERE [Page] = '" & Page & "'") 'Check if the page details were found or not If rsPageDetails.EOF Then 'Report the error Session("Message") = "Invalid page requested or page not found." Response.Redirect("Messages.asp") End If 'Store the content Title = Trim(rsPageDetails("Title")) Content = Trim(rsPageDetails("Content")) 'Close the open recordset rsPageDetails.Close %> <% = Title %>
<% = Content%>