Software Process Development
REPORT OF A REVIEW OF SOFTWARE PROCESS MODELS AND APPLICATION IN THE IMPLEMENTATION OF A WEB-BASED FAN CLUB
APPLICATION
MSc. Advanced Information Technology
- INTRODUCTION
This report comprises a research into software process models, description of three of such models in terms of their origin, application, advantages and disadvantages and finally, the application of an appropriate one of these models for the development of a web-based fan club application for a pop artiste, Usher
- SOFTWARE PROCESS MODELS
Despite the fact that ‘the software crisis' has been recognised for nearly 40 years, much software development can still be characterised as a chaotic cycle of ‘code and fix'. This can work fairly well understood. However, as the system grows, adding or changing functionality becomes difficult, bugs becomes harder to identify and fix, and schedule becomes more and more difficult to manage.
System development methodologies impose a disciplined process upon software systems development, with the aim of making it more predictable and more efficient. They do this by structuring the development process into phases, stages and deliverables, with a strong emphasis on the planning and control of the various development activities. While there are many and various methodologies available, the underlying approach taken is normally based on one of a small number of development models.
- THE WATERFALL LIFECYCLE MODEL
The Lifecycle Model is the traditional approach to systems development, with each stage of the lifecycle defined by the products or ‘deliverables' produced when the stage is completed. The methods and techniques that are recommended dataflow diagrams, entity models, state transition diagrams all form part of an overall system development process.
This is managed by setting stages in the project for the completion of particular diagrams, for the development of software systems, or for the installation of items of hardware.
This model was christened ‘waterfall' because each stage produces a product, which is passed on to the next stage, and-on-and-on, like a stream of water, that is, the development is seen as flowing steadily downwards through phases. (Bell D., 2000)
Typical stages in a waterfall lifecycle include :
- Initial study
- Feasibility
- Investigation
- Business requirements definition
- System design
- System specification
- Development
- Testing
- Implementation
- Review.
- Origin
The waterfall model originated in 1970 when W.W. Royce in his paper proposed a sequential software development model which at that time he described as flawed, in that it is ‘risky and invites failure'. He advocated an iterative approach to software development (Wikipedia, 2005)
However, his criticism of the model and advocacy for an iterative model was unpopular.
- Application
It has applications in the astronautic industry; software used in launching rockets are usually developed using this model, because all that is required for such applications needs to be known before the project starts. It is used by NASA.
It also used for military applications. The US air force uses it (Wikipedia, 2005).
- Advantages
- Each step is well defined.
- Each step produces a well defined deliverable.
- Each step can be verified or validated.
- It divides complex tasks into smaller, more manageable tasks.
- It does not require a lot of expertise.
- It is reliable and affords ease of maintenance.
- Disadvantages
- It makes no stipulations about what methods are used at any of its stages.
- It does not stipulate what notations are used for the products at each stage.
- Just as a waterfall cannot flow upwards, a defect in an earlier phase detected at a later phase, cannot be rectified.
- It presents no formal means of exercising management control over a project.
- It has poor adherence to principles of practical project as change can result in distortion of the process.
- It does not accommodate unforeseen circumstances, as all requirements are specified from the beginning
- THE SPIRAL MODEL
The model is divided into four quadrants. Starting from the top left, each cycle will initially identify and determine objectives, alternatives and constraints. In the second quadrant, alternatives are evaluated and risk are analysed. In the third quadrant, the prototype is developed. Each cycle then completes in the fourth quadrant by planning for the next cycle of the spiral.
- Origin
The forward momentum created in the Waterfall Model can cause significant problems. To overcome these, Boehm developed a model that adopted an evolutionary approach towards the development of information systems. The spiral model (see Figure 1) is a procedure, rather than a lifecycle, because it introduces activities that are concerned with process rather than product.
Figure 1 The Spiral Model
- Application
Spiral model is best suited for large projects with high risk factor. Like the development of operating systems or large database software. Large organizations such as Microsoft, IBM often use it. (Wikipedia, 2005)
- Advantages
- Most important features completed first.
- Ensure product release for a particular date.
- Useful for project path not on the critical path.
- It offers great flexibility, because it incorporates periodic risk analysis.
- It is used spans the entire life of the application, so the application is properly maintained.
- It minimizes risk, because it identifies uncertainty in the next stage and can clarify the situation using prototyping.
- Disadvantages
- It requires skilled and well-trained personnel for each phase
- Due to its iterative nature, the development process may be prolonged.
- Unlike the waterfall, it requires highly skilled man-power in risk assessment.
- It requires testing over time before it can be trusted.
- It is only suitable for object-oriented systems and cannot be used for systems that require formal review and audit policies and it does not adhere to these.
- Quite difficult to manage because the requirement specifications are not well defined from the commencement of the project.
- THE AGILE MODEL
Agile methods are people-oriented rather than process-oriented. The goal of traditional development methods is to development methods is to define a process that will work well whoever happens to be using it. Agile assert that no process will ever make up for a lack of skill in the development team, so the primary role of any process is to support the development team in its work. (Martin Fowler, 2005)
- Origin
A recent survey by the British Computer Society (BCS) found that poor management of project requirements and scope were the most common causes of project failure. But systems development projects, user requirements are often not clear at the start, for a number of reasons:
- Users may be unsure of what they want
- It may be difficult to identify their tacit knowledge about day-to-day processes
- They may not have been consulted sufficiently
- User requirement may be misunderstood
- Departmental and strategic requirements may be purely defined
- External factors can cause requirements to change
- A ‘simple' change to requirements may require a fundamental redesign of the system, with large time and cost implications.
- Application
A variety of methods are available under the general heading of Agile. Varying in formality and scope they range from SCRUM (at the most ‘lightweight'), through Crystal Orange and X, to DSDM (as the most ‘heavyweight' method). All are based on the frequent release of working systems to the user, and, unlike more traditional methods, all place the commitment to be on-time and on-budget above prescribed systems functionality.
- Advantages
- Agile designs are emerge over time, evolving to fulfil new requirements and take advantage of new technologies as appropriate.
- Using verbal rather than written communication.
- An early concrete and continuing feedback.
- An incremental planning approach.
- A flexible schedule of the development process.
- The design process lasts as long as the system lasts.
- Disadvantages
- Comprehensive documentation does not ensure project success, in fact, it increases your chance of failure.
- Team co-location required - maybe.
- Scope is looked at in “Short Cycles” ‘ what can be done in a week ‘
- Drive towards product only focus on maintenance issues, Documentation (legal, safety of life) and Design on the fly.
- Scalability
- REASONS FOR CHOOSING WATERFALL MODEL.
The reason why I choose the waterfall model is because
- The requirement are well known in advance
- There are no high risk in our course work
- The nature of the requirements will not change significantly
- The hardware and software is well known
- There is enough time to proceed sequentially.
- It is best suited for this type of application.
Reference
Bell D. (2000). Software Engineering; A programming approach.
Humphrey, W.S. (1989). Managing the Software Process. Addison-Wesley. Discusses software management through the Capability Maturity Model, or CMM
Jones G.W.(1990) Software Engineering. Retrieved on December 12th, 2005 fromhttp://sern.ucalgary.ca/students/theses/KimJohnson/chapter1.htm#SoftwareProcessModels
Lux Group (2005). Project Lifecycles: Waterfall, Rapid Application Development, and All That. Retrieved on January 10th, 2006 from http://www.lux-seattle.com/about/whitepapers/waterfall.asp
Potts C. (1998) Software Process models retrieved on January 10th, 2006 from http://www.cc.gatech.edu/computing/SW_Eng/people/Faculty/Colin.Potts/Courses/3302/1-08-mgt/
Wikipedia (2005). Waterfall Model. Retrieved on December 18th, 2006 from http://en.wikipedia.org/wiki/Waterfall_model
Wikipedia (2005). Spiral Model. Retrieved on December 18th, 2006 from http://en.wikipedia.org/wiki/Spiral_model
Martin Fowler. (13 Dec 2005) The New Technology. Retrieved on January 04th, 2007 from http://martinfowler.com/articles/newMethodology.html
APPENDICES
PROCESS FLOW DIAGRAM
index.html
signup.html
validate.pl
signup.pl
information.html
personalDetails.dat
viewdetails.html
updatedetails.html
viewdetails.pl
updatedetails.pl
searchdetails.pl
APPLICATION STORY BOARD
Application Structure
index.html
viewdetails.html
information.html
updatedetails.html
viewdetails.pl
searchdetails.pl
modify.pl
Navigational Structure
index.html
viewdetails.html
information.html
updatedetails.html
viewdetails.pl
searchdetails.pl
modify.pl
Individual Pages
Usher's World
Usher's Fan Club
HomeRegistration
sponsor's
poster
sponsor's
poster
Copyright 2007 Usher, All Rights Reserved
index.html
Usher's World
Usher's Fan Club
Login Error
Please Try Again
HomeRegistration
Copyright 2007 Usher, All Rights Reserved
LoginError.html
Usher's World
Usher's Fan Club
HomeRegistration
signup.html
Copyright 2007 Usher, All Rights Reserved
Signup.html
Usher's World
Usher's Fan Club
Successful Registered
HomeRegistration
Copyright 2007 Usher, All Rights Reserved
ConfReg.html
Usher's World
Usher's Fan Club
Registration Error! User Already Registered
HomeRegistration
Copyright 2007 Usher, All Rights Reserved
RegError.html
Welcome To Usher's World
Photos
Albums
Interviews
Usher's World
HomeRegistration
Image
Poster
Image
Poster
Image
Poster
Copyright 2007 Usher, All Rights Reserved
Welcome.html
CODES
JavaScipt for Validation of form
//Ensure all fields are completed and done correctly
function ValidateEntries() {
// the message variable holds the string that
//will be displayed if there is a blank field
var message = "";
if (document.membershipform.fname.value == "")
{
message += "\n\tFirstname";
}
if (document.membershipform.lname.value == "")
{
message += "\n\tLastname";
}
if (document.membershipform.addy.value == "")
{
message += "\n\tAddress";
}
if (document.membershipform.email.value == "")
{
message += "\n\tEmail Address";
}
if (document.membershipform.age.value == "")
{
message += "\n\tAge";
}
if (document.membershipform.sex.value == "")
{
message += "\n\tSex";
}
if (document.membershipform.membernotes.value == "")
{
message += "\n\tMember notes";
}
if (document.membershipform.username.value == "")
{
message += "\n\tUsername";
}
if (document.membershipform.password.value == "")
{
message += "\n\tPassword";
}
if (document.membershipform.password2.value == "")
{
message += "\n\tConfirm Password";
}
//confirm password
if ((document.membershipform.password.value) != (document.membershipform.password2.value)){
if (message != ""){ //There has been an error before this
message += "\nIn addition\n\t";
}
message += "Please confirm password correctly";
}//end if
if (message != "") //Error occured
{
// Alert user of the missing information
alert("The following fields are required but have been left blank" + message +
"\n\nPlease ensure they are completed then try re-submitting the form. ");
return false; //error do not submit the form to server
}
return true; // OK, there was no error, so allow the form to be submitted.
}//End of function
//check for correct email format
function CheckEmail(){
//ensure the '@' character appears after atleast one character in the email provided
var i;
for(i=1; i<=(document.membershipform.email.value.length - 1); i++){
if( (document.membershipform.email.value.substr(i,1))== '@' ){
var offset;
//The reason for the offset
//ensure that there is at least another character after the '@'
//then a '.' after that, i.e. for example 'ere@d.co'
for(offset=i+2; offset<=(document.membershipform.email.value.length - 1); offset++){
if( (document.membershipform.email.value.substr(offset,1))== '.' ){
return true;
}//end if
}//end for
alert("Invalid email address format");
return false;
}//end if
}//end for
alert("Invalid email address format");
return false;
}
//Check if a numeric value was entered for age
function CheckAge(field){
var cnt;
if (isNaN(field.value)){
cnt=(field.value.length - 1);
field.focus();
alert("Invalid entry\n Your entry must be a number");
return false;
}
}
Perl Script for validating username and password
#!/usr/bin/perl
use CGI qw(:standard);
#pass parameters to variables
$varUsername = param("username");
$varPassword = param("password");
#Read from file
open (RECORDER, "personalDetails.dat") || die "File cannot be opened";
while($line = <RECORDER>)
{
chomp $line;
($username, $password) = split(", ", $line);
#checking username
if ($varUsername eq $username) {
$correctUser = 1;
}else {
$correctUser = 0;
}
#checking password
if ($varPassword eq $password){
$correctPassword = 1;
last; # go to the last line
}
else{
$correctPassword = 0;
}
}
close (RECORDER);
#*****************Writing html file***********************
print qq(
<!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" />
<title>Kirk Franklin Fan Club</title>
<link href="http://myweb.lsbu.ac.uk/~oderindo/kirk.css" rel="stylesheet" media="screen">
</head>
<body >
<table width="771" height="590" border="0" align="center" background="http://myweb.lsbu.ac.uk/~oderindo/images/signup_bg.jpg">
<tr >
<td height="80" rowspan="2" valign="top" > </td>
<td width="3%" height="80" rowspan="2" valign="top" > </td>
<td width="50%" height="29" valign="top" > </td>
<td height="80" colspan="2" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="104" valign="top" ><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/tlc.jpg" width="270" height="102" alt="sponsors" /></td>
</tr>
<tr >
<td width="8%" height="97" rowspan="2" valign="top" > </td>
<td height="28" colspan="3" valign="top" class="style6" bordercolor="#FFFFFF" ><table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#673499">
<tr align="center">
<td> </td>
</tr>
</table></td>
<td width="8%" height="97" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="346" colspan="3" valign="top" ><table width="100%" height="331" border="0">
<tr>
<td height="17" colspan="3" align="left"><span class="style5">Username/Password Validation </span> </td>
</tr>
<tr>
<td width="72%" height="120" valign="top">
<p>
</p>
<p>
</p>);
#**************************Check for validation result*******************
if ($correctUser && $correctPassword) {
grantAccess();
}
elsif ($correctUser && !$correctPassword) {
invalidPassword();
}
else {
denyAccess();
}
#**************************Display in accordane with validation result*******************
print qq(<p> </p><p> </p>);
print qq( </td>
<td width="28%" colspan="2" align="right" valign="top"><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/six.jpg" width="173" height="214" alt="" /></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="70" colspan="5"> </td>
</tr>
</table>
</body>
</html>);
sub grantAccess {
print "<p align ='center'>Hello $username, as a member you have access to information on the server</p>";
print "<p align ='center'><a href='http://myweb.lsbu.ac.uk/~oderindo/information.html' class= 'hlight'>Click here to access information</a></p> ";}
sub invalidPassword {
print "<p align ='center'>You have not entered the right password for $username.</p>";
print "<p align ='center'><a href='http://myweb.lsbu.ac.uk/~oderindo/index.html' class= 'hlight'>Try again</a></p> ";}
sub denyAccess {
print "<p align ='center'>Both the username and password you gave are not found on the server.</p>";
print "<p align ='center'><a href='http://myweb.lsbu.ac.uk/~oderindo/index.html' class= 'hlight'>Make another attempt</a> </p>";}
Perl Script for writing member's detail to personalDetails.dat
#!/usr/bin/perl
#Validate username and password
#Collects user input and writes to file (personalDetails.dat)
use CGI qw(:standard);
use CGI::Carp(fatalsToBrowser);
#store user input to memory variable
$username = param("username");
$password = param ("password");
$firstname = param("fname");
$lastname = param("lname");
$addy = param("addy");
$age = param("age");
$sex = param("sex");
$email = param("email");
$membernotes = param("membernotes");
#***************Check for dupliction***********************************
#open file for reading
open(READER, "personalDetails.dat");
$duplicate=0;
while($line = <READER>)
{
chomp $line; # removes carriage return
($varusername, $varpassword) = split(", ", $line);
if (($varusername eq $username) ){
$duplicate = 1;
last; # go to the last line
}
}
close(READER);
#****************Write the details to file starts**********************
#open file for reading
open(WRITER, ">>personalDetails.dat");
if (!$duplicate){
#move file pointer to the beginning of file
seek(WRITER, 0, 0);
#write to file in order
#convert all commas in address and membernotes fields to blank space
#so that it is not mis-read as a delimiter in the datafile
$addy=~ tr/,/ /;
$membernotes=~ tr/,/ /;
$memberdetails = $username.", ".$password.", " .$firstname.", " .$lastname.", ". $addy.", ".$age.", " .$email.", ".$sex.", ".$membernotes."\r\n";
print WRITER $memberdetails;
} #end if
#close file
close(WRITER);
#****************Write the details to file ends**************************
#Writing html file
print "Content-type: text/html\n\n";
print qq(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">);
print qq(<html xmlns="http://www.w3.org/1999/xhtml">);
print qq(<head>);
print qq(<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />);
print qq(<title>Kirk Franklin Fan Club</title>);
print qq(<link href="http://myweb.lsbu.ac.uk/~oderindo/kirk.css" rel="stylesheet" media="screen">);
print qq(</head>);
print qq(<body>);
print qq(<table width="771" height="599" border="0" align="center" background="http://myweb.lsbu.ac.uk/~oderindo/images/signup_bg.jpg">);
print qq(<tr >);
print qq(<td height="31" colspan="5" valign="top" > </td>);
print qq(</tr>);
print qq(<tr>);
print qq(<td height="102" valign="top" > </td>);
print qq(<td width="9%" height="102" valign="top" > </td>);
print qq(<td width="51%" valign="top" ><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/tlc.jpg" width="270" height="102" alt="sponsors" /></td>);
print qq(<td width="24%" valign="top" > </td>);
print qq(<td height="102" valign="top" > </td>);
print qq(</tr>);
print qq(<tr>);
print qq(<td width="8%" height="97" rowspan="2" valign="top" > </td>);
print qq(<td height="17" colspan="3" valign="top" class="style6" bordercolor="#FFFFFF" ><table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#673499">);
print qq(<tr align="center">);
print qq(<td width="100%"><span class="style11"> </span></td>);
print qq(</tr>);
print qq(</table></td>);
print qq(<td width="8%" height="97" rowspan="2" valign="top" > </td>);
print qq(</tr>);
print qq(<tr >);
print qq(<td height="425" colspan="3" valign="top" ><table width="100%" border="0">);
if(!$duplicate){
print qq(<tr>);
print qq(<td height="17" colspan="3" align="left"><span class="style5">Duplicate information </span>);
print qq(<p class="style5">Sorry the username $username has been taken</p> );
print qq(<p class="style5"><a href="http://myweb.lsbu.ac.uk/~oderindo/signup.html" class= 'hlight'> Click here to try again</a></p>);
print qq(</p>);
print qq(</td>);
print qq(</tr>);
}
else{
print qq(<tr>);
print qq(<td height="17" colspan="3" align="left"><span class="style5">Registration Confirmation </span>);
print qq(<p class="style5">Congratulations! $firstname $lastname you are now a registered member of the Kirk Franklin fan club</p> );
print qq(<p class="style5"><a href="http://myweb.lsbu.ac.uk/~oderindo/index.html" class= 'hlight'> Click here to login</a></p>);
print qq(</p>);
print qq(</td>);
print qq(</tr>);
}
print qq(<tr>);
print qq(<td width="70%" valign="top"> </td>);
print qq(<td width="30%" colspan="2" valign="top"><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/two.jpg" width="189" height="200" alt="official sponsors of this site" /></td>);
print qq(</tr>);
print qq(</table>);
print qq(</td>);
print qq(</tr>);
print qq(</table>);
print qq(</body>);
print qq(</html>);
PerlScript for retireve user details and display on a table
#!/usr/bin/perl
#This script reads the details of members of the fan club from
#personalDetails.dat and writes them into an HTML file for rendering.
use CGI qw(:standard);
use CGI::Carp(fatalsToBrowser);
#store user input to memory variable
$varusername = param("username");
$varpassword = param("password");
#open file for reading
open (RECORDFILE, "personalDetails.dat") || die "Unable to open file";
# go to the beginning of file
seek(RECORDFILE, 0, 0);
#iterate through file reading only the firstnames and lastnames of members
$foundIt = 0;
while($line = <RECORDFILE>)
{
chomp $line; # removes carriage return
($username, $password, $firstname, $lastname, $address, $age, $email, $sex, $notes) = split(", ", $line);
if (($varusername eq $username) && ($varpassword eq $password)){
$foundIt = 1;
last; # go to the last line
}
}
#close the file
close (RECORDFILE);
print qq(
<!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" />
<title>Kirk Franklin Fan Club</title>
<link href="http://myweb.lsbu.ac.uk/~oderindo/kirk.css" rel="stylesheet" media="screen">
<script language="javascript" src="http://myweb.lsbu.ac.uk/~oderindo/kirk.js" >
</script>
</head>
<body >
<table width="771" height="590" border="0" align="center" background="http://myweb.lsbu.ac.uk/~oderindo/images/signup_bg.jpg">
<tr >
<td height="80" rowspan="2" valign="top" > </td>
<td width="3%" height="80" rowspan="2" valign="top" > </td>
<td width="50%" height="29" valign="top" > </td>
<td height="80" colspan="2" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="104" valign="top" ><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/tlc.jpg" width="270" height="102" alt="sponsors" /></td>
</tr>
<tr >
<td width="8%" height="97" rowspan="2" valign="top" > </td>
<td height="28" colspan="3" valign="top" class="style6" bordercolor="#FFFFFF" ><table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#673499">
<tr align="center">
<td width="20%"><a href="http://myweb.lsbu.ac.uk/~oderindo/index.html" class="style11">Home</a></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/information.html">Information</a></span></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/viewdetails.html">View Details </a></span></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/updatedetails.html">Update Details </a><a href="gallery.html"></a></span></td>
<td width="20%"> </td>
</tr>
</table></td>
<td width="8%" height="97" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="346" colspan="3" valign="top" ><table width="100%" border="0">
<tr>
<td height="17" colspan="3" align="left"><span class="style5">Viewing Client details </span></td>
</tr>
<tr>
<td width="72%" valign="top" class="style6">
<p> </p>
);
#***********Check if it was actually found and display****************************
if($foundIt == 1) {
print qq(<table width="80%" border="1" class="style6" bordercolor="#673499">
<tr>
<td colspan="2" class="style5">Your details are as follows: -</td>
</tr>
<tr>
<td class="style5">Username</td>
<td class="style6">$username</td>
</tr>
<tr>
<td class="style5">Password</td>
<td class="style6">$password</td>
</tr>
<tr>
<td class="style5">Lastname</td>
<td class="style6">$lastname</td>
</tr>
<tr>
<td class="style5">Firstname</td>
<td class="style6">$firstname</td>
</tr>
<tr>
<td class="style5">Home Address</td>
<td class="style6">$address</td>
</tr>
<tr>
<td class="style5">Age</td>
<td class="style6">$age</td>
</tr>
<tr>
<td class="style5">Email </td>
<td class="style6">$email</td>
</tr>
<tr>
<td class="style5">Sex</td>
<td class="style6">$sex</td>
</tr>
<tr>
<td class="style5">Note</td>
<td class="style6">$notes</td>
</tr>
</table>);
}else{ #*******************username and password not found***************
printqq(<table width="80%" border="1" class="style6">
<tr>
<td colspan="2" class="style5">Could not find any record with <b>username:</b> <em>$varusername</em> and <b>password:</b> <em>$varpassword</em></td>
</tr>
</table>);
}
print qq( </td>
<td width="28%" colspan="2" align="right" valign="top"><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/four.jpg" width="173" height="214" alt="" /></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="70" colspan="5"> </td>
</tr>
</table>
</body>
</html>);
PerlScript for retrieving member details and displaying in form to allow for modification
#!/usr/bin/perl
#This script reads the details of members of the fan club from
#personalDetails.dat and writes them into an HTML file for rendering.
use CGI qw(:standard);
use CGI::Carp(fatalsToBrowser);
#store user input to memory variable
$varusername = param("username");
$varpassword = param("password");
$male = "male";
#open file for reading
open (RECORDFILE, "personalDetails.dat") || die "Unable to open file";
# go to the beginning of file
#seek(RECORDFILE, 0, 0);
#iterate through file reading only the firstnames and lastnames of members
while($line = <RECORDFILE>)
{
chomp $line; # removes carriage return
($username, $password, $firstname, $lastname, $address, $age, $email, $sex, $notes) = split(", ", $line);
if (($varusername eq $username) && ($varpassword eq $password)){
#$foundIt = 1;
last; # go to the last line
}
}
#close the file
close (RECORDFILE);
print qq(
<!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" />
<title>Kirk Franklin Fan Club</title>
<link href="http://myweb.lsbu.ac.uk/~oderindo/kirk.css" rel="stylesheet" media="screen">
<script language="javascript" src="http://myweb.lsbu.ac.uk/~oderindo/kirk.js" >
</script>
</head>
<body >
<table width="771" height="597" border="0" align="center" background="http://myweb.lsbu.ac.uk/~oderindo/images/signup_bg.jpg">
<tr >
<td height="80" rowspan="2" valign="top" > </td>
<td width="3%" height="80" rowspan="2" valign="top" > </td>
<td width="50%" height="29" valign="top" > </td>
<td height="80" colspan="2" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="104" valign="top" ><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/tlc.jpg" width="270" height="102" alt="sponsors" /></td>
</tr>
<tr >
<td width="8%" height="97" rowspan="2" valign="top" > </td>
<td height="28" colspan="3" valign="top" class="style6" bordercolor="#FFFFFF" ><table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#673499">
<tr align="center">
<td width="20%"><a href="http://myweb.lsbu.ac.uk/~oderindo/index.html" class="style11">Home</a></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/information.html">Information</a></span></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/viewdetails.html">View Details </a></span></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/updatedetails.html">Update Details </a><a href="gallery.html"></a></span></td>
<td width="20%"> </td>
</tr>
</table></td>
<td width="8%" height="97" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="346" colspan="3" valign="top" ><table width="100%" height="331" border="0">
<tr>
<td height="17" colspan="3" align="left"><span class="style5">Updating Client details </span></td>
</tr>
<tr>
<td width="72%" height="120" valign="top" class="style6"><form id="form1" name="form1" method="post" action="/cgiwrap/~oderindo/modify.pl">
<table width="100%" border="0">
<tr>
<td width="36%" align="right" class="style6">Username</td>
<td width="64%" class="style6"><input name="username" type="text" id="username" value="$username" /></td>
</tr>
<tr>
<td align="right" class="style6">Password</td>
<td class="style6"><input name="password" type="text" id="password" value="$password" /></td>
</tr>
<tr>
<td align="right" class="style6">Firstname</td>
<td class="style6"><input name="firstname" type="text" id="firstname" value="$firstname" /></td>
</tr>
<tr>
<td align="right" class="style6">Lastname</td>
<td class="style6"><input name="lastname" type="text" id="lastname" value="$lastname" /></td>
</tr>
<tr>
<td align="right" class="style6">Address</td>
<td class="style6"><textarea name="address" id="address" >$address</textarea></td>
</tr>
<tr>
<td align="right" class="style6">Age</td>
<td class="style6"><input name="age" type="text" id="age" size="3" maxlength="3" value="$age" /></td>
</tr>
<tr>
<td align="right" class="style6">Email</td>
<td class="style6"><input name="email" type="text" id="email" value="$email" /></td>
</tr>
<tr>
<td align="right" class="style6">Sex</td>
<td class="style6" ><select name="sex" id="sex" >);
if ($sex eq "male"){
print qq(<option value="male" selected="selected">male</option>
<option value="female">female</option>);
}elsif ($sex eq "female"){
print qq(<option value="male" >male</option><option value="female" selected="selected">female</option>);
}
print qq(
</select>
</td>
</tr>
<tr>
<td align="right" class="style6">Notes</td>
<td class="style6"><textarea name="membernotes" >$notes</textarea></td>
</tr>
<tr>
<td align="right" class="style6"> </td>
<td class="style6"><input name="Update" type="submit" class="button" id="Update" value="Update" />
<input name="Reset" type="reset" class="button" id="Reset" value="Reset" /></td>
</tr>
</table>
</form>
<p> </p>
<p> </p></td>
<td width="28%" colspan="2" align="right" valign="top"><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/three.jpg" width="173" height="214" alt="" /></td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>);
Modify the members details and give feed back
#!/usr/bin/perl
#This script searches for the line number of a particular record
#It then deletes the record at that lin
#Afterwards the inserts a new record on the same line
use CGI qw(:standard);
use CGI::Carp(fatalsToBrowser);
#store user input to memory variable
$newusername = param("username");
$newpassword = param ("password");
$newfirstname = param("firstname");
$newlastname = param("lastname");
$newaddress = param("address");
$newage = param("age");
$newsex = param("sex");
$newemail = param("email");
$newnotes = param("membernotes");
#write to file in order
#convert all commas in address and membernotes fields to blank space
#so that it is not mis-read as a delimiter in the datafile
$newaddress=~ tr/,/ /;
$newnotes=~ tr/,/ /;
$newmemberdetails = $newusername.", ".$newpassword.", " .$newfirstname.", " .$newlastname.", ". $newaddress.", ".$newage.", " .$newemail.", ".$newsex.", ".$newnotes."\r\n";
#to modify the file in place,we read from it
#write changes to a temporay file
#then rename the temporary back to the original
$old = "personalDetails.dat";
$new = "tempfile.dat";
open(OLD, "<", $old) or die "can't open $old: $!";
open (NEW, ">", $new) or die "can't open $new: $!";
#match username with record in file
while($line = <OLD>){
chomp $line;
($username, $password, $firstname, $lastname, $address, $age, $email, $sex, $notes) = split(", ", $line);
$memberdetails = $username.", ".$password.", " .$firstname.", " .$lastname.", ". $address.", ".$age.", " .$email.", ".$sex.", ".$notes."\r\n";
#checking username
if ($newusername eq $username) {
print NEW $newmemberdetails;
next if ($newusername eq $username);
}else{
print NEW $memberdetails;
}
}
close (OLD) or die "can't close $old: $!";
close (NEW) or die "can't close $new: $!";
rename($old, "$old.orig") or die "can't rename $old to $old.orig: $!";
rename($new, $old) or die "can't rename $new to $old: $!";
#delete($old);
print qq(
<!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" />
<title>Kirk Franklin Fan Club</title>
<link href="http://myweb.lsbu.ac.uk/~oderindo/kirk.css" rel="stylesheet" media="screen">
<script language="javascript" src="http://myweb.lsbu.ac.uk/~oderindo/kirk.js" >
</script>
</head>
<body bgcolor="#cccccc">
<table width="771" height="597" border="0" align="center" background="http://myweb.lsbu.ac.uk/~oderindo/images/signup_bg.jpg">
<tr >
<td height="80" rowspan="2" valign="top" > </td>
<td width="3%" height="80" rowspan="2" valign="top" > </td>
<td width="50%" height="29" valign="top" > </td>
<td height="80" colspan="2" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="104" valign="top" ><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/tlc.jpg" width="270" height="102" alt="sponsors" /></td>
</tr>
<tr >
<td width="8%" height="97" rowspan="2" valign="top" > </td>
<td height="28" colspan="3" valign="top" class="style6" bordercolor="#FFFFFF" ><table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#673499">
<tr align="center">
<td width="20%"><a href="http://myweb.lsbu.ac.uk/~oderindo/index.html" class="style11">Home</a></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/information.html">Information</a></span></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/viewdetails.html">View Details </a></span></td>
<td width="20%"><span class="style11"><a href="http://myweb.lsbu.ac.uk/~oderindo/updatedetails.html">Update Details </a><a href="gallery.html"></a></span></td>
<td width="20%"> </td>
</tr>
</table></td>
<td width="8%" height="97" rowspan="2" valign="top" > </td>
</tr>
<tr >
<td height="346" colspan="3" valign="top" ><table width="100%" height="331" border="0">
<tr>
<td height="17" colspan="3" align="left"><span class="style5">Updating Client details </span></td>
</tr>
<tr>
<tr>
<td height="17" colspan="3" align="left"><span class="style6">$newfirstname $lastname ypur details have been updated successfully </span></td>
</tr>
<tr>
<td width="72%" height="120" valign="top" class="style6"><form id="form1" name="form1" method="post" action="/cgiwrap/~oderindo/modify.pl">
<table width="100%" border="0">
<tr>
<td width="36%" align="right" class="style6">Username</td>
<td width="64%" class="style6"><input name="username" type="text" id="username" value="$newusername" readonly="true"/><span class="style6">cannot be editted</span></td>
</tr>
<tr>
<td align="right" class="style6">Password</td>
<td class="style6"><input name="password" type="text" id="password" value="$newpassword" /></td>
</tr>
<tr>
<td align="right" class="style6">Firstname</td>
<td class="style6"><input name="firstname" type="text" id="firstname" value="$newfirstname" /></td>
</tr>
<tr>
<td align="right" class="style6">Lastname</td>
<td class="style6"><input name="lastname" type="text" id="lastname" value="$newlastname" /></td>
</tr>
<tr>
<td align="right" class="style6">Address</td>
<td class="style6"><textarea name="address" id="address" >$newaddress</textarea></td>
</tr>
<tr>
<td align="right" class="style6">Age</td>
<td class="style6"><input name="age" type="text" id="age" size="3" maxlength="3" value="$newage" /></td>
</tr>
<tr>
<td align="right" class="style6">Email</td>
<td class="style6"><input name="email" type="text" id="email" value="$newemail" /></td>
</tr>
<tr>
<td align="right" class="style6">Sex</td>
<td class="style6" ><select name="sex" id="sex" >);
if ($newsex eq "male"){
print qq(<option value="male" selected="selected">male</option>
<option value="female">female</option>);
}elsif ($newsex eq "female"){
print qq(<option value="male" >male</option><option value="female" selected="selected">female</option>);
}
print qq(
</select>
</td>
</tr>
<tr>
<td align="right" class="style6">Notes</td>
<td class="style6"><textarea name="membernotes" >$newnotes</textarea></td>
</tr>
<tr>
<td align="right" class="style6"> </td>
<td class="style6"><input name="Update" type="submit" class="button" id="Update" value="Update" />
<input name="Reset" type="reset" class="button" id="Reset" value="Reset" /></td>
</tr>
</table>
</form>
<p> </p>
<p> </p></td>
<td width="28%" colspan="2" align="right" valign="top"><img name="" src="http://myweb.lsbu.ac.uk/~oderindo/images/three.jpg" width="173" height="214" alt="" /></td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>);
We provide a professional essay writing service that thousands of our customers use as an effective way of improving their grades, improving their research and saving them lots of time.

