I may be on the wrong page to post my code but below is the login.php code that I am currently working on but there are other pages also if i need to copy and paste the code I will. I also know the page is in html and JavaScript but that is what the class required however I thought I could use much of the code into a new <?php page named login.php. if I am thinking correctly or else please let me know..
<!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>
<SCRIPT TYPE="text/javascript">
<!--
//Disable right click script
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>
<meta name="description" content="The best Christian online Gaming site with a new twist.
FREE, no Facebook, no Zynga, no pop ups asking for cash; players having fun in new Blyte World community!
Come join us!" />
<meta name="keywords" content="free, game, multi player, role playing, blyte world, online game" />
<title> Blyte World Password Validation</title>
<link rel="stylesheet" href="content/login.css" type="text/css" media="screen" />
<link rel="shortcut icon" type="image/x-icon" href="/blyteworld-game.ico.html" />
<link rel="canonical" href="
http://www.blyteworld.com" />
<meta property="og:image" content="
http://www.blyteworld.com/content/inter ... game02.jpg" />
<script type="text/javascript">
// This is a javascript function for validating the password
function validatePassword() {
try {
var strPassword;
var regexp;
// setup an error to throw if we have a password error
var err = new Error();
err.name = "pwd_error";
// get the password from the form element
strPassword = document.getElementById("txtPassword").value;
if(strPassword == "") {
alert("Password cannot be blank");
} if(strPassword == "") {
alert("Password cannot be blank");
}else {
err.message = "";
// check the length of the character
if(strPassword.length < 8 || strPassword.length > 15) {
err.message = "Password length must be between 8 to 15 characters\n";
}
// Check for Upper case letter
regexp = /[A-Z]/; // Regular expression for upper case letter
if(!regexp.test(strPassword)) {
err.message += "Password must contain at least one upper case letter (A-Z)\n";
}
// Check for lower case letter
regexp = /[a-z]/; // Regular expression for lower case letter
if(!regexp.test(strPassword)) {
err.message += "Password must contain at least one lower case letter (a-z)\n";
}
// Check for number - Password must contain at least one number
regexp = /[0-9]/; // Regular expression for number
if(!regexp.test(strPassword)) {
err.message += "Password must contain at least one number (0-9)";
}
// If valid password, show success message; otherwise throw an error
if(err.message != "") {
throw err;
} else {
alert("Password validated successfully.");
}
// if we had a password error
if (ex.name == "pwd_error") {
alert("Password validation failed.\n" + err.message);
// Clear the value in the password textbox
document.getElementById("txtPassword").value = "";
document.getElementById("txtPassword").focus();
// otherwise, its some other javascript error
} else {alert("An error occurred!.\n" + "Error Name : " + ex.name + "\nError Message : " + ex.message");}
// ex.name is the type/name of error like RangeError, TypeError, etc.
// ex.message is the description of the error.
}
}
}
</script>
</head>
<body>
<div class="login_page_maincontainer">
<!-- Start of Page Header -->
<div class="login_page_header">
<div class="login_page_title">
<img src="content/interface/world1.png" alt="Blyte World" />
</div>
<div class="login_page_free">
<img src="content/interface/header_welcome.gif" alt="Free Strategy and Dating Game" />
</div>
<div class="clearthis"></div>
</div>
<!-- End of Page Header -->
<!-- Start of Page Menu -->
<div class="login_page_menu">
<div class="login_page_button">
<a href="login.php" title="Home"><img src="content/interface/home.gif" alt="Home" /></a>
</div>
<div class="login_page_button">
<a href="register.php" title="Sign Up"><img src="content/interface/login_signup.gif" alt="Sign Up" /></a>
</div>
<div class="login_page_button">
<a href="
http://www.blyteworld./faq" title="Community" target="_blank"><img src="content/interface/login_faq.gif" alt="FAQ" /></a>
</div>
<div class="login_page_button">
<a href="about.php" title="About"><img src="content/interface/login_About B.W.gif" alt="About Blyte World" /></a>
</div>
<div class="clearthis"> </div>
</div>
<!-- End of Page Menu -->
<div class="login_page_forms">
<!-- Start of User Login -->
<div class="login_page_userlogin_form">
<div class="login_page_userlogin_form_header">
<br />
<img src="content/interface/userlogin_header.gif" alt="User Login" /><br />
<br />
</div>
<br />
<br />
<form action=authenticate.php method=post name="login">
<div class="login_page_userlogin_form_field">
<img src="content/interface/userlogin_login.gif" alt="Login:" class="login_page_forms_img" />
<input type="text" name="username" class="login_page_forms_input" />
</div>
<div class="login_page_userlogin_form_field">
<img src="content/interface/userlogin_password.gif" alt="Password:" class="login_page_forms_img" />
<input type="password" name="password" class="login_page_forms_input" />
</div>
<div class="login_page_userlogin_form_button">
<input type="image" src="content/interface/userlogin_enter.gif" alt="Enter" class="button" />
</div>
</form>
<br />
<div id="userlogin_links">
<a href="register.php" id="register"><strong><span>Register >>></span></strong></a>
<br />
<a href="forgottenpassword.php" id="notregister"><strong><span>Forgot your Blyte World game login?</span></strong></a>
</div>
</div>
<!-- End of User Login -->
<div id="sitesearch_header"></div>
<br />
<img src='content/interface/mrated.gif' align="center"width="192" height="64" alt="Rated M" />
<br />
<br />
<br />
<br />
<br />
</div>
<div class="login_page_body">
<img src='content/interface/blyteworldgif.gif' width="576" height="430" alt="body image" class="login_page_body_image" />
</div>
<div id="clearthis_contentbody"></div>
</div>
<!-- Start of Page Footer -->
<br />
<br />
<div id="page_footer">
Copyright © 2012 <strong>Blyte Records Inc.</strong> | <a href="tos.php">Terms of use</a><br />
</div>
<!-- End of Page Footer -->
</body>
</html>