Save the given code in "login.php" file in admin directory. This code is used to develop the admin login page in php.
<?php
include("../functions.php");
$username="";
$password="";
if(isset($_POST['submit']))
{
if($_POST['username']=="")
$username="Please provide username";
if($_POST['password']=="")
$password="Please provide password";
$status = adminlogin();
if($status == 1)
echo "<script type='text/javascript'>alert('Invalid Username/Password.');</script>";
//if($status == 0)
//{}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>Login</title>
<link rel="STYLESHEET" type="text/css" href="../styles/student_forms.css" />
<!--<script src="scripts/validation.js" type="text/javascript" ></script>-->
</head>
<body>
<?php include("header.php"); ?>
<!-- Form Code Start -->
<div id='student_forms' >
<form name="adminloginForm" method='post' accept-charset='UTF-8' >
<fieldset align="left" style="background-repeat:no-repeat;background-image: url(../images/admin-login-form.jpg);">
</br></br>
<div class='required'>* Required Fields</div></br>
<div class="containerleft"><span class='required'>*<span>
<label class='labels'>Username :</label></br>
<input type="text" name="username" maxlength="50">
<div class="required" align="left"><?php echo $username; ?></div>
<span class='required'>*<span>
<label class='labels' >Password :</label></br>
<input type="password" name="password" maxlength="50">
<div class="required" align="left"><?php echo $password ?></div></br>
<input type="submit" name="submit" value="Submit"/></br></br>
<div class='labels'><a href="forgot-password.php">Forgot Password?<a>  <a href="../">Back</a></div>
</div>
</fieldset>
</form>
</div>
<?php include("footer.php"); ?>
</body>
</html>
<?php
include("../functions.php");
$username="";
$password="";
if(isset($_POST['submit']))
{
if($_POST['username']=="")
$username="Please provide username";
if($_POST['password']=="")
$password="Please provide password";
$status = adminlogin();
if($status == 1)
echo "<script type='text/javascript'>alert('Invalid Username/Password.');</script>";
//if($status == 0)
//{}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>Login</title>
<link rel="STYLESHEET" type="text/css" href="../styles/student_forms.css" />
<!--<script src="scripts/validation.js" type="text/javascript" ></script>-->
</head>
<body>
<?php include("header.php"); ?>
<!-- Form Code Start -->
<div id='student_forms' >
<form name="adminloginForm" method='post' accept-charset='UTF-8' >
<fieldset align="left" style="background-repeat:no-repeat;background-image: url(../images/admin-login-form.jpg);">
</br></br>
<div class='required'>* Required Fields</div></br>
<div class="containerleft"><span class='required'>*<span>
<label class='labels'>Username :</label></br>
<input type="text" name="username" maxlength="50">
<div class="required" align="left"><?php echo $username; ?></div>
<span class='required'>*<span>
<label class='labels' >Password :</label></br>
<input type="password" name="password" maxlength="50">
<div class="required" align="left"><?php echo $password ?></div></br>
<input type="submit" name="submit" value="Submit"/></br></br>
<div class='labels'><a href="forgot-password.php">Forgot Password?<a>  <a href="../">Back</a></div>
</div>
</fieldset>
</form>
</div>
<?php include("footer.php"); ?>
</body>
</html>
0 Comments:
Post a Comment