Location: PHPKode > scripts > Simple Login Class > simple-login-class-1-00/login.php

 *@Author: Balaji J H
 *@Version: 1.00
 *@Package Name: Simple Login Class
 *@HomePage: http://jhbalaji.com
 *@EMail: hide@address.com / hide@address.com
 *@Developed For: BloggerPoster.com
 *@Copyright: Balaji J H,BloggerPoster.com
 *@License: Free For Personal & Commerical Username but Header and Copyright information must stay intact!


$error = '0';

if (isset($_POST['submitBtn'])){
	// Get user input
	$username = isset($_POST['username']) ? $_POST['username'] : '';
	$password = isset($_POST['password']) ? $_POST['password'] : '';
	// Try to login the user
	$jh = new loginjh();
	$error = $jh->loginUser($username,$password);

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Simple PHP Login</title>
<meta http-equiv="Pragma" content="no-cache"> <!-- Important for security -->
<meta http-equiv="Expires" content="-1">
<meta name="robots" content="index,follow">
<meta name="author" content="Balaji J H">
<meta name="email" content="hide@address.com">
<meta name="copyright" content="Balaji J H">
<meta name="Charset" content="UTF-8">
<meta name="Distribution" content="Global">
<meta name="Rating" content="General">
<meta name="Robots" content="INDEX,FOLLOW">
<meta name="Revisit-after" content="1 Day">
<link rel="stylesheet" href="stylesheet.css"> <!-- Main Stylesheet -->

<div id="header">
<div id="title"><a href="index.php">
<h1>Simple PHP Login</h1></a></div>
<div id="login"><a 

<?php if ($error != '') {?>
<div id="main">
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> 
<label>Username</label><input name="username" size="20" type="text"> 
<label>Password</label><input name="password" size="20" type="password">
<input value="Login" name="submitBtn" type="submit"> 
<p>Not registered yet? It's quick &amp; easy to do so
<a href="register.php">here</a></p>

    if (isset($_POST['submitBtn'])){

<div id="main">
<h2>Login Status</h2>

	if ($error == '') {
		echo "<h3>Welcome Admin, $username! <br/>You are now logged in!<br/><br/>";
		echo '<a href="index.php">Now you can now visit the Password Protected Page!</a></h3>';
	else echo '<h3>'.$error.'</h3>';



<div id="footer">
Created by <a href="http://www.jhbalaji.com/" target="_blank">Balaji</a></div>

Return current item: Simple Login Class