PEAR Articles

  Home arrow PEAR Articles arrow Page 3 - Building the View Details Page in a PE...
PEAR ARTICLES

Building the View Details Page in a PEAR CMS
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-11-05

    Table of Contents:
  • Building the View Details Page in a PEAR CMS
  • Code Explained
  • Table with Navigation Panel
  • Displaying the Article

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Building the View Details Page in a PEAR CMS - Table with Navigation Panel


    (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 the link that provides a facility to log out a user:


    <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>

    Also, a link to the admin section of the site is 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,” 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 checks have been done, the code continues to build a new HTML table that will now host the article that is to be viewed:


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

    <tr>

    <td colspan="2" class="title">&nbsp;</td>

    </tr>

    <?php

    First the script calls the db class. This is necessary because we need to use the methods of this class to access and manipulate the database information. Then the connx.php file is included; we need the database connection credentials which are stored there:

    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 9 - Follow our Sitemap