Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_SESSION['user'])) Redirect::to('profile');
- ?>
- <div class="pageTitle"><h3>Sign in</h3></div>
- <div id="contentMain">
- <div id="contentPage">
- <div class="subPageContainer">
- <div class="subPageContainer">
- <div class="subPageTitleLeft pageTitle">Sign in into your account</div>
- </div>
- <div class="normalContentBox">
- <?php
- if(isset($_POST['Login']))
- {
- if(strlen($_POST['nume']) && strlen($_POST['parola']))
- {
- $q = DB::prepare("SELECT `".DB::$tbl->a->id."` FROM `".DB::$tbl->a->tblname."` WHERE `".DB::$tbl->a->name."` = ? AND `".DB::$tbl->a->password."` = ?");
- $q->execute(array($_POST['nume'],md5($_POST['parola'])));
- if($q->rowCount())
- {
- echo '<font color="green"><center>You\'ve been logged with successfuly! Wait for redirect...</center></font><br><br>';
- while($row = $q->fetch(PDO::FETCH_OBJ)) {
- $_SESSION['user'] = $row->{DB::$tbl->a->id};
- Redirect::to('profile');
- }
- } else {
- echo '<center>Login failed</center><br><br>';
- }
- } else echo '<center><font color="red"><strong>Complete every field!</strong></font></center><br>';
- }
- ?>
- <form action="" method="post">
- <table border="0" cellspacing="0" cellpadding="0" width="380" align="center">
- <tbody>
- <tr>
- <td width="80">
- <div class="formLabel"><span class="text">Name</span>: </div>
- </td>
- <td width="300" class="textarea">
- <input name="nume" type="text" class="textarea" id="nume"><br><br>
- </td>
- </tr>
- <tr>
- <td>
- <div class="formLabel"><span class="text">Password</span>: </div>
- </td>
- <td><input name="parola" type="password" class="textarea" id="parola"></td>
- </tr>
- <tr>
- <td colspan="2">
- <br>
- <div align="center"><input class="loginButton" name="Login" type="submit" id="Login" value="Login"></div>
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </div>
- </div>
- </div>
- </div>
Add Comment
Please, Sign In to add comment