Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('../core/ClassMain.php');
- require_once('class.secure-jh.php');
- require_once('../config.php');
- $Main = new Main();
- $Main->connect($driver,$host,$user,$password,$db,$charset);
- //smarty
- require ('../smarty/libs/Smarty.class.php');
- $smarty = new Smarty;
- $smarty->compile_check = true;
- //smarty Debug
- //$smarty->debugging = true;
- 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);
- }
- if (isset($_POST['submitBtn'])){
- //proceed to display options
- if ($error != '') {
- $smarty->assign('Content', '
- <h2>Login Status</h2>
- <h3>'.$error.'</h3>
- ');
- }
- else {
- $smarty->assign('Content', '
- <h2>Login Status</h2>
- <h3>Welcome '.$username.'! <br/>You are now logged in!<br/><br/>
- <meta http-equiv="refresh" content="3;url=index.php?pg=home">Please wait to be redirected<br>
- <a href="index.php?pg=home">Click Here if you Don`t want to wait <br>or your browser doesn`t redirect you automaticly.</a></h3>
- ');
- }
- }
- if(!isset($error)){
- $error = 'login';
- }
- $smarty->assign('PageTitle', 'Login');
- $smarty->assign('error', $error);
- $smarty->display('login.tpl');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement