PHP
  Home arrow PHP arrow Page 4 - The Design of an Intranet Application Framework
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

The Design of an Intranet Application Framework
By: Chris Neeman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 6
    2007-07-25


    Table of Contents:
  • The Design of an Intranet Application Framework
  • Intranet File Structure
  • Design Code/Templates
  • More on Templates

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    The Design of an Intranet Application Framework - More on Templates
    ( Page 4 of 4 )

    The next two HTML pages are the templates that are going to be used to display the intranet and application pages respectively. The templates give the applications a uniform, neat and presentable look. They also, like the CSS sheet, make it easy to apply cosmetic changes in one place for all pages to accept those changes. In other words, it makes it very easy to maintain web pages.

    Fig1. Intranet template

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <link href="intranet.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .style1 {color: #FFFFFF}
    body {
       background-color: #a4c2c2;
    }
    -->
    </style>
    </head>
    <body>
     
    <table width="100%" border="0" cellspacing="2">
     
      <tr>
     
        <td colspan="2" valign="top" class="logo">DAMARA NAMA PUBLISHING </td>
     
      </tr>
        <tr>
     
        <td width="16%" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
     
        <td width="84%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="welcome" -->welcome<!-- TemplateEndEditable --></td>
     
      </tr>
     
      <tr>
     
        <td width="16%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="navigate" -->navigate<!-- TemplateEndEditable --></td>
     
        <td valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="main" -->main<!-- TemplateEndEditable --></td>
     
      </tr>
     
      <tr>
     
        <td valign="top">&nbsp;</td>
     
        <td valign="top" class="copyright">copyright&copy;2007</td>
     
      </tr>
     
    </table>
    </body>
    </html>

    Fig2. Application template

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <link href="intranet.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    body {
       background-color: #a4c2c2;
    }
    -->
    </style></head>
    <body>
     
    <table width="100%" border="0" cellspacing="2">
     
      <tr>
     
        <td colspan="2" valign="top" class="logo">DAMARA NAMA PUBLISHING </td>
     
      </tr>  
     
      <tr>
     
        <td width="13%" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
     
        <td width="87%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="welcome" -->welcome<!-- TemplateEndEditable --></td>
     
      </tr>
     
      <tr>
     
        <td width="13%" valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="navigate" -->navigate<!-- TemplateEndEditable --></td>
     
        <td valign="top" bgcolor="#FFFFFF"><!-- TemplateBeginEditable name="main" -->main<!-- TemplateEndEditable --></td>
     
      </tr>
     
      <tr>
     
        <td valign="top">&nbsp;</td>
     
        <td valign="top" class="copyright">copyright&copy;2007</td>
     
      </tr>
     
    </table>
    </body>
    </html>

    Since we are discussing the wider intranet components, I thought we could deal with the validation class before moving on to the application framework components. The validation class is mainly used to validate form data. It has five functions:

    • filledin() - This function checks to see if the form variables are filled in.
    • isadmin() - This function checks to see if a user has admin level access.
    • checkemail() - This function checks to see if the email address supplied is valid.
    • savepass() - This function saves a password in hash form.
    • genpass() - This function generates a seven character password.

    Below is a fuller outline of the validation class:

    <?php
    class validate{
       function filledin($form_vars){
        
    foreach($form_vars as $key=> $value)
        
    {
          
    if(empty($key) || ($value == ''))
            
    return FALSE;
         
    }
        
    return TRUE;
      
    }

       function isadmin($sesslevel){
        
    if($sesslevel == "admin"){
          
    return TRUE;
        
    }else{
          
    return FALSE;
        
    }
      
    }

       function checkemail($aEmail){
        
    if(eregi("^([a-z.])+([a-z])+@([a-z])+(.)([a-z]{3})$",$aEmail))
          
    return TRUE;
        
    else
          
    return FALSE;
      
    }//end function

       /*password functions*/
      
    function savepass($apass){
     
        $salt = 'SHIFLETT';
     
        $password_hash = md5($salt . md5($apass . $salt));

         return $password_hash;
      
    }

       function genpass(){
     
       $chars = "1234567890abcdefghij345678klmnopqrs1234tuvwxyz1234567890";
     
       $thepass = '';
     
       for($i=0;$i<7;$i++){
     
         $thepass .= $chars{rand() % 39};
     
       }
     
       return $thepass;
     
      }
    }
    ?>

    Conclusion

    This article discussed the design of the intranet as well as the applications that it will host. The next article will discuss the components of the application framework.



     
     
    >>> More PHP Articles          >>> More By Chris Neeman
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek