<?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!
*****************************************/
require_once('class.secure-jh.php');
if (isset($_POST['submitBtn'])){
// Get user input
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password1 = isset($_POST['password1']) ? $_POST['password1'] : '';
$password2 = isset($_POST['password2']) ? $_POST['password2'] : '';
// Try to register the user
$jh = new loginjh();
$error = $jh->registerUser($username,$password1,$password2);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<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 -->
</head>
<body>
<div id="header">
<div id="title"><a href="index.php">
<h1>Simple PHP Login</h1></a></div>
<div id="login"><a
href="login.php">Login</a></div>
</div>
<?php if ((!isset($_POST['submitBtn'])) || ($error != '')) {?>
<div id="main">
<h2>Sign Up</h2>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<label>Username</label><input id="username" name="username" onchange="toggle_username('username')" type="text"><br>
<label>Password</label><input name="password1" value="" type="password"><br>
<label>Confirm</label><input name="password2" value="" type="password"><br><br>
<br>
<input value="Register" name="submitBtn" type="submit">
</form>
</div>
<?php
}
if (isset($_POST['submitBtn'])){
?>
<div id="main">
<h2>Registration Result:</h2>
<?php
if ($error == '') {
echo "<h3>";
echo " Hey, $username you're Username is now Preserved & Registered!<br/><br/>";
echo ' <a href="index.php">You can login here</a>';
echo "</h3>";
}
else echo '<h3>'.$error.'</h3>';
?>
</div>
<?php
}
?>
<div id="footer">
Created by <a href="http://www.jhbalaji.com/" target="_blank">Balaji</a></div>
</body></html>