Home arrow PHP arrow Page 2 - User Authentication for a Project Management Application

User Information - PHP

In the last article, we discussed in detail the user creation script. We looked at what information the script gets from the form and how it "cleans" and verifies form values, and then looked at how the user is informed about his or her log-in credentials. In this article, the conclusion to our four-part series, we'll finish the discussion.

TABLE OF CONTENTS:
  1. User Authentication for a Project Management Application
  2. User Information
  3. The Script
  4. Checking the User and Email
By: David Web
Rating: starstarstarstarstar / 1
August 18, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The error message is only displayed if it is not empty; otherwise, the entire row of the table is hidden from the user. The remainder of the code collects further information about the user, such as the email address, username, password and other required information.

<tr>

<td width="122"><div align="left">Name:</div></td>

<td width="525"><input name="fname" type="text" class="input40" size="40"></td>

</tr>

<tr>

<td width="122"><div align="left">Surname:</div></td>

<td width="525" class="login"><input name="sname" type="text" size="40"></td>

</tr>

<tr>

<td width="122"><div align="left">Username:</div></td>

<td width="525" class="login"><input name="uname" type="text" size="40">

<span class="tooltip">username must be in format: <strong>name.surname</strong></span></td>

</tr>

<tr>

<td width="122"><div align="left">Password:</div></td>

<td width="525" class="login"><input name="upass" type="text" size="40" value="<?php echo $rndpass; ?>"></td>

</tr>

<tr>

<td><div align="left">Email:</div></td>

<td class="login"><input name="email" type="text" size="40"></td>

</tr>

<tr>

<td><div align="left">Access Level</div></td>

<td class="login"><label>

<select name="select">

<option>admin</option>

<option>normal</option>

</select>

</label></td>

</tr>

Here is the code for the row that collects the password information:

<tr>

<td width="122"><div align="left">Password:</div></td>

<td width="525" class="login"><input name="upass" type="text" size="40" value="<?php echo $rndpass; ?>"></td>

It can be hidden from the administrator and sent directly to the newly created user. This way, only the user will know what his or her password is. I’ve left this option open for you to decide what to do based on your situation.

The user can access the password recovery script by clicking on the “forgot your password?” link on the login page. See the screen below:


Fig. 1 login page with the “forgotten password?” link.


Fig. 2 password recovery page

The password script handles the password recovery process, in case the user forgets his or her password. It will ask the user for the username and an email address. To prevent fraud, the script will check to see if the username and email address exists in the database and that they both belong to the same person. Only after it is satisfied that it belongs to the same person will it then email the password to the given email address.

So let's look at the code that does the work. Click on the link below to see it. 



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

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

Dev Shed Tutorial Topics: