PHP
  Home arrow PHP arrow Page 2 - Building a User Management Application
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

Building a User Management Application
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2008-11-24


    Table of Contents:
  • Building a User Management Application
  • The database
  • Templates
  • Style Sheet

  • 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


    Building a User Management Application - The database
    ( Page 2 of 4 )

    I chose to use a database over a file-based storage system because of the security it offers. A file can basically be opened and read by anyone who manages to access your root. Information about a database is a bit harder to come by.

    For our system I've created a database called "user" that contains a table called "users." This table has six fields, each of which takes a different kind of information about a user. Below is a list of fields that are available in the table:


    • uid - This field creates a unique user id for each new user.

    • uname - This field stores the user name.

    • upass - This field stores a forty-character-long password for the user.

    • Level - This field stores the user's access level.

    • Email - This field stores the user's email address.

    • Active - This field stores information about the state of the user's account activation.


    Below is the SQL code for the database and table, as well as sample data. Simply copy and paste it into your MYSQL client:


    # Database : `user`

    #

    # --------------------------------------------------------

    #

    # Table structure for table `users`

    #


    CREATE TABLE `users` (

    `uid` int(4) NOT NULL auto_increment,

    `uname` char(50) default NULL,

    `upass` char(40) default NULL,

    `level` char(8) NOT NULL,

    `email` char(50) NOT NULL,

    `active` char(32) default NULL,

    PRIMARY KEY (`uid`)

    ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;


    #

    # Dumping data for table `users`

    #


    INSERT INTO `users` VALUES (1, 'david', '9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684', 'admin', 'david@dweb.com', '1');

    INSERT INTO `users` VALUES (2, 'joe', '1390470c09daf4c6179c197e6aebe9821c9ca92d', 'normal', 'joe@smith.com', '0');

    INSERT INTO `users` VALUES (3, 'jack', 'monday', 'normal', 'jack@smith.com', '0');

    To give extra protection to our user management system, I've included certain restrictions on the fields of the table. For example, the password can have up to forty characters, the username up to fifty, etc. Also, to make the retrieval of data faster, I've optimized the fields by, for example, using the char type instead of the varchar type (the latter is slower):


    `uname` char(50) default NULL,

    `upass` char(40) default NULL,

    `level` char(8) NOT NULL,

    `email` char(50) NOT NULL,

    `active` char(32) default NULL,




     
     
    >>> More PHP Articles          >>> More By David Web
     

       

    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 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek