PEAR Articles

  Home arrow PEAR Articles arrow Page 3 - Building an Authors Page for a PEAR CM...
PEAR ARTICLES

Building an Authors Page for a PEAR CMS
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-11-12

    Table of Contents:
  • Building an Authors Page for a PEAR CMS
  • The Code Explained
  • HTML Table
  • Extracting Author Information

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Building an Authors Page for a PEAR CMS - HTML Table


    (Page 3 of 4 )

    The next part of the HTML code starts to set up an HTML table that will contain the navigation panel information, such as logout and the authors link that enables a user to view a list of all authors in the system: 

    <table width="100%" border="0" cellspacing="0" class="navbord">

    <tr>

    <td colspan="2" bgcolor="#FFFFFF">&nbsp;</td>

    </tr>

    <tr>

    <td colspan="2" bgcolor="#0066FF" class="section"><strong>Section</strong></td>

    </tr>

    <tr class="navbord">

    <td class="nav"><a href="logout.php">Logout</a> </td>

    <td><img src="images/user.gif" width="16" height="16" alt="" /></td>

    </tr>

    <tr class="navbord">

    <td colspan="2" class="nav"><a href="main.php">Home</a></td>

    </tr>

    <tr class="navbord">

    <td colspan="2" class="nav"><a href="authors.php">Authors</a></td>

    </tr>

    <?php if($_SESSION['level']=="admin"){?>

    <tr class="navbord">

    <td colspan="2" class="nav"><a href="admin/index.php">Admin</a></td>

    </tr>

    <?php }?>

    </table>

    A link to the admin section of the site is also provided, but only users with administration level access are allowed to use it. To prevent any unauthorized access to that part of the site, the code checks to see if the session variable called “level” exists and that the value that is stored in that variable is “admin.” If the value is indeed “admin,” then the navigation option is displayed for the user; otherwise, it is not shown


    <?php if($_SESSION['level']=="admin"){?>

    <tr class="navbord">

    <td colspan="2" class="nav"><a href="admin/index.php">Admin</a></td>

    </tr>

    <?php }?>

    Once the admin check has been done, the code continues to build a new HTML table that will now host the list of authors that is to be viewed. Also, a new section of PHP code is started. The first part of the code calls the db class which contains the methods and functions that we require to manipulate the MySQL database. The second file to be included in this script is the connx.php file that contains the database connection details:

    <!-- InstanceEndEditable --></td>

    <td width="95%" valign="top"><!-- InstanceBeginEditable name="EditRegion3" -->

    <table width="100%" border="1">

    <tr><td></td></tr>

    <?php

    include 'db.php';

    include 'connx.php';

    More PEAR Articles Articles
    More By David Web

    blog comments powered by Disqus

    PEAR ARTICLES ARTICLES

    - Installing PEAR
    - PEAR: an Introduction
    - Managing robots.txt using PHP: Generating Dy...
    - Deleting Authors from a PEAR Content Managem...
    - PEAR CMS: Index and Delete Scripts
    - Listing Articles for a PEAR Content Manageme...
    - Building an Authors Page for a PEAR CMS
    - Building the View Details Page in a PEAR CMS
    - Creating the Main Pages of a PEAR CMS
    - Completing the Login Script for a PEAR CMS
    - User Authentication for a PEAR CMS
    - A PEAR CMS: Examining the Code
    - Building a Content Management System with PE...
    - Installing a PEAR Package
    - My PEAR: The Beginning


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap