Guest User

Login.php panel Burned

a guest
Jun 29th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. <?php
  2. if(isset($_SESSION['user'])) Redirect::to('profile');
  3. ?>
  4. <div class="pageTitle"><h3>Sign in</h3></div>
  5. <div id="contentMain">
  6. <div id="contentPage">
  7. <div class="subPageContainer">
  8. <div class="subPageContainer">
  9. <div class="subPageTitleLeft pageTitle">Sign in into your account</div>
  10. </div>
  11. <div class="normalContentBox">
  12. <?php
  13. if(isset($_POST['Login']))
  14. {
  15. if(strlen($_POST['nume']) && strlen($_POST['parola']))
  16. {
  17. $q = DB::prepare("SELECT `".DB::$tbl->a->id."` FROM `".DB::$tbl->a->tblname."` WHERE `".DB::$tbl->a->name."` = ? AND `".DB::$tbl->a->password."` = ?");
  18. $q->execute(array($_POST['nume'],md5($_POST['parola'])));
  19. if($q->rowCount())
  20. {
  21. echo '<font color="green"><center>You\'ve been logged with successfuly! Wait for redirect...</center></font><br><br>';
  22. while($row = $q->fetch(PDO::FETCH_OBJ)) {
  23. $_SESSION['user'] = $row->{DB::$tbl->a->id};
  24. Redirect::to('profile');
  25. }
  26. } else {
  27. echo '<center>Login failed</center><br><br>';
  28. }
  29. } else echo '<center><font color="red"><strong>Complete every field!</strong></font></center><br>';
  30. }
  31. ?>
  32. <form action="" method="post">
  33. <table border="0" cellspacing="0" cellpadding="0" width="380" align="center">
  34. <tbody>
  35. <tr>
  36. <td width="80">
  37. <div class="formLabel"><span class="text">Name</span>: </div>
  38. </td>
  39. <td width="300" class="textarea">
  40. <input name="nume" type="text" class="textarea" id="nume"><br><br>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td>
  45. <div class="formLabel"><span class="text">Password</span>: </div>
  46. </td>
  47. <td><input name="parola" type="password" class="textarea" id="parola"></td>
  48. </tr>
  49. <tr>
  50. <td colspan="2">
  51. <br>
  52. <div align="center"><input class="loginButton" name="Login" type="submit" id="Login" value="Login"></div>
  53. </td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. </form>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
Add Comment
Please, Sign In to add comment