Home arrow PHP arrow Page 7 - Cracking The Vault (part 1)

Entry Points - PHP

Electronic documents are all well and good - but when you work onthem collaboratively, they can end up being more difficult to handle thanordinary pieces of paper. Multiple versions, competing standards, accesspermissions and revision history tracking are just some of the issues thatarise in a paperless office. This article discusses building and deployinga document management system across your network - and also teachesbeginnners a little bit about designing Web-based applications with PHP andmySQL in the process.

TABLE OF CONTENTS:
  1. Cracking The Vault (part 1)
  2. Just Another Day At The Office
  3. An Evil Plan Is Born
  4. Setting The Ground Rules
  5. Design Time
  6. Start Me Up
  7. Entry Points
  8. Seeding The System
  9. Red And Green Clouds
  10. Digging Deeper
  11. Basic Maintenance
  12. The D Word
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 2
May 14, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Once the user is successfully logged in, "out.php" takes over and generates a list of documents available to the user; this list includes documents the user may have uploaded, as well as documents the user has "view" rights for. If this is the first time you are logging in, you will probably see nothing; once you add documents, the screen will fill up.



Before we look at this script, however, I want to draw your attention to the script "add.php", accessible from the top right corner of the page and used to add new documents to the system. I'll explain this first, since it offers a logical starting point.

The first thing "add.php" (and every other script) does is to verify the existence of a valid session - this is necessary to prevent unauthorized users from viewing the pages. If a session doesn't exist, the browser is immediately redirected to the error handler.

<? // check to ensure valid session, else redirect session_start(); if (!session_is_registered("SESSION_UID")) { header("Location:error.php?ec=1"); exit; } // includes include("config.php"); ?>

Assuming a session exists, a basic HTML page is built.

<html> <head> <basefont face="Verdana"> </head> <body bgcolor="White"> <? include("menu.inc");?> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td bgcolor="#0000A0"> <b><font face="Arial" color="White">Add New Document</font></b> </td> </tr> </table> <!-- lots of code --> </body> </html>

I'm not going to go into details here - it's essentially a bunch of HTML tables, all dressed up to look pretty - but I will draw your attention to the file "menu.inc", which contains the main menu for the page and is include()d on every page.

This article copyright Melonfire 2001. All rights reserved.

 
 
>>> More PHP Articles          >>> More By Vikram Vaswani, (c) Melonfire
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


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

Dev Shed Tutorial Topics: