Interested in building your own CMS? In this article Mitchell shows us how to build a multi-page article system that can be used in any web-based CMS...
Building a Multi-Page Article System With ASP/PHP - Displaying a List of Articles (Page 5 of 6 )
It's very easy to display a list of articles from the articles table in our database. We simply loop through the articles table and output the title and summary for each article. We also setup a link to read the entire article, which we will look at shortly. Shown below is the code for both ASP and PHP:
ASP Code
<!-- #INCLUDE file="db.asp" --> <%
objRS.Open "select * from articles order by articleId asc"
while not objRS.EOF %> <font face="Verdana" size="4"><b><%=objRS("title")%></b></font><br><br> <font face="Verdana" size="2"> <%=objRS("summary")%><br><br> <a href="fullarticle.asp?articleId=<%=objRS("articleId")%>">Read More...</a> </font> <hr><br> <% objRS.MoveNext wend
%>
PHP Code
include("db.php");
$result = mysql_query("select * from articles order by articleId asc");
Displaying an Individual Article To display an individual article, we simply list the pages in that article as links and start by displaying the title and content of the first page: