Create a scripts of html


Assignment:

Create improve emailremove.html so that the user can request having his/her email address removed, the form validated properly before being posted to "removeemailaddress.php".

Create using the database eisdb.mdb the PHP script called "removeemailaddress.php" to accommodate "emailremove.html" so that all fields (pass_user, pass_word and pass_email) can be removed from eisdb.mdb and a confirmation message is passed back to the user.

function

checkmailaddress(str) {
// Set variables
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)

// Check that first string entered is valid
if (str.indexOf(at)==-1){
alert("This is NOT a invalid E-mail address!")
//String is not valid
return false
}
// Check that strings entered are valid
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")
//String is not valid
return false
}
// Check that strings entered are valid
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")
//String is not valid
return false
}
// Check that strings entered are valid
if (str.indexOf(at,(lat+1))!=-1){
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")
//String is not valid
return false
}
// Check that strings entered are valid
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")
//String is not valid
return false
}
// Check that strings entered are valid
if (str.indexOf(dot,(lat+2))==-1){
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")
//String is not valid
return false
}
// Check that strings entered are valid
if (str.indexOf(" ")!=-1){
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")
//String is not valid
return false
}
//String is valid
return true
}


function ValidateForm(){
var mailaddress=document.EmailRemove.txtEmail

/* Check field value for valid input*/
if ((mailaddress.value==null)||(mailaddress.value==""))
{
alert("This is NOT a invalid E-mail address. A valid email address looks like this ' [email protected] '. Please try again!")/* Alert if field has no valid input*/
mailaddress.focus()/*set focus on mail address field*/
return false
}
/*Check for valid mail adress*/
if (checkmailaddress(mailaddress.value)==false){
mailaddress.value=""
mailaddress.focus() /*Check for valid mail adress*/
return false
}
return true
}

Attachment:- eisdb.mdb

Solution Preview :

Prepared by a verified Expert
PHP Web Programming: Create a scripts of html
Reference No:- TGS01938496

Now Priced at $25 (50% Discount)

Recommended (94%)

Rated (4.6/5)