Filters and Login Systems for Web Application Security
(Page 1 of 4 )
In this article we will be building our application, using the concepts discussed in the previous articles. Any web site that is selective in the kind of users that it wants to grant access to will need some method of filtering. This filtering is usually done through a login system. This (and more) is what we will be building. This article is the third part of an eight-part series.
The application
The application will consists of the following files:
- login.php – This script will be responsible for authenticating users.
- logout.php - This script will log users out of the system.
- passman.php – This script will be responsible for managing passwords.
- register.php – This script will be responsible for registering new users.
- fns.php – This script contains all the functions that will be used by the site.
- config.inc – This script contains connection details.
- was.css – This script contains the styles for the site.
- was.dwt.php – This script is a template.
The template for the site is actually very simple. It has the following HTML:
<!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="was.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="99%" border="1">
<tr>
<td bgcolor="#333333" class="header">Web Secure</td>
</tr>
<tr>
<td><!-- TemplateBeginEditable name="main" -->main<!-- TemplateEndEditable --></td>
</tr>
<tr>
<td class="copy">©2008</td>
</tr>
</table>
</body>
</html>
And the following look:
The Cascading Style Sheet is even simpler. It has the following code:
body,html {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
.header{
text-align:center;
font-size:24px;
color:#FFFFFF;
font-weight:100;
}
.copy{
font-size:9px;
text-align:right;
}
.list{
font-size:11px;
}
.listtop{
border-bottom:1px;
border-bottom-color:#000000;
border-bottom-style:solid;
font-weight:bold;
background-color:#CCCCFF;}
.temptitle {
font-size: 24px; font-weight: normal; color: #ffffff;
background-color:#003366;
text-align:center;
}
#myimg{
margin-right:60px;
margin-left:600px;
}
#mytxt{
text-align:left;
position:absolute;
left: 237px;
top: 39px;
height: 27px;
font-size:24px;
color:#FFFFFF;
background-color:#003366;
}
The CSS simply defines a few styles that are used by the PHP scripts.
Next: Definition and Storage File >>
More PHP Articles
More By David Web