Friday 3 October 2014

LOGIN SCRIPT IN PHP MYSQL FULL PROJECT DOWNLOAD

AAVIK KUMAR PRODUCTION



main.php
---------------------------
<?php
/*
 * Main.php
 *
 * This is an example of the main page of a website. Here users will be able to login.
 * However, like on most sites the login form doesn't just have to be on the main page,
 * but re-appear on subsequent pages, depending on whether the user has logged in or not.
 *
 * Originally written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
 * Last Updated by the Angry Frog: October 19, 2011
*/

include("include/session.php");
global $database;
$config = $database->getConfigs();
?>

<html>
<head>
<title><?php echo $config['SITE_NAME']; ?> - Main</title>

<style type="text/css">

html body {
margin: 100;
padding: 0;
background-color: #C8DFF6;
}
body {
    font: 12px/1.5 Lucida Grande, Arial, Helvetica, 'Liberation Sans', FreeSans, sans-serif;
     background-image:url('ppl.jpg');
     background-position: right center;;
     background-repeat: no-repeat;
    
}


</style>
</head>
<body>

<table>
<tr><td>


<?php
/**
 * User has already logged in, so display relavent links, including
 * a link to the admin center if the user is an administrator.
 */
if($session->logged_in){
   echo "<h1>Logged In</h1>";
   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;"
       ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
   if($session->isAdmin()){
      echo "[<a href=\"admin/index.php\">Admin Center</a>] &nbsp;&nbsp;";
   }
   echo "[<a href=\"process.php\">Logout</a>]";
}
else{
?>

<h1>Connecting World!!!</h1>
<br/>
<?php
/**
 * User not logged in, display the login form.
 * If user has already tried to login, but errors were
 * found, display the total number of errors.
 * If errors occurred, they will be displayed.
 */
if($form->num_errors > 0){
   echo $form->num_errors." error(s) found";
}
?>
<fieldset>
  <legend>LOGIN:</legend>
<form action="process.php" method="POST">

<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>>
Remember me &nbsp;&nbsp;&nbsp;&nbsp;
<input type="hidden" name="sublogin" value="1">
<input type="submit" value="Login"></td></tr>
<tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
<tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
</table>
</form>
</fieldset>

</td></tr>
</table>
<?php
}
echo "<br><br>";
include("include/view_active.php");
?>

</body>
</html>

constant.php
--------------------------
<?php
/**
 * Database Constants - these constants are required
 * in order for there to be a successful connection
 * to the MySQL database. Make sure the information is
 * correct.
 */

define("DB_SERVER", "localhost");
define("DB_USER", "root");
define("DB_PASS", "");
define("DB_NAME", "bestloginphp");

/**
 * Database Table Constants - these constants
 * hold the names of all the database tables used
 * in the script.
 */
define("TBL_USERS", "users");


DOWNLOAD FULL CODE BY AAVIK KUMAR

No comments:

Post a Comment