Guest User

Untitled

a guest
May 27th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. Deals Admin
  5. </title>
  6. <link href="css/index.css" rel="stylesheet" type="text/css">
  7.  
  8. </head>
  9. <body>
  10.  
  11. <?php
  12. include 'dbcAddUser.php';
  13.  
  14. $user_email = mysql_real_escape_string($_POST['email']);
  15.  
  16. if ($_POST['Submit']=='Login')
  17. {
  18. $md5pass = md5($_POST['pwd']);
  19. $sql = "SELECT id,user_email,table_name FROM users WHERE
  20. user_email = '$user_email' AND
  21. user_pwd = '$md5pass' AND user_activated='1'";
  22.  
  23. $result = mysql_query($sql) or die (mysql_error());
  24. $num = mysql_num_rows($result);
  25.  
  26. if ( $num != 0 ) {
  27.  
  28. // A matching row was found - the user is authenticated.
  29. session_start();
  30.  
  31. list($user_id,$user_email,$table_name) = mysql_fetch_row($result);
  32. // this sets variables in the session
  33. $_SESSION['user']= $user_email;
  34. $_SESSION['table_name']= $result['table_name'];
  35.  
  36. if (isset($_GET['ret']) && !empty($_GET['ret']))
  37. {
  38. header("Location: $_GET[ret]");
  39. } else
  40. {
  41. $secondCon = include ('dbcAddRows.php');
  42.  
  43. if (!$secondCon) { echo "error on second con"; exit(); } else {
  44.  
  45.  
  46. $check = mysql_query ("SELECT * FROM `ricmetalstergmailcom` LIMIT 0,1");
  47.  
  48. //".$_SESSION['table_name']."
  49.  
  50. if ($check){
  51. echo "table exists";
  52. echo $_SESSION['table_name'];
  53. }else{
  54. echo $_SESSION['table_name'];
  55. echo "table doesnt exist";
  56. }
  57.  
  58. exit();
  59.  
  60.  
  61. //header("Location: myaccount.php");
  62. }
  63. }
  64. //echo "Logged in...";
  65. exit();
  66. }
  67.  
  68. header("Location: index.php?msg=Invalid Login");
  69. //echo "Error:";
  70. exit();
  71. }
  72.  
  73. ?>
  74.  
  75.  
  76. <?php if (isset($_GET['msg'])) { echo "<div class=\"msg\"> $_GET[msg] </div>"; } ?>
  77.  
  78.  
  79. <p>&nbsp;</p>
  80. <table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
  81. <tr><td>
  82. <table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
  83. <tr>
  84. <td class="tl">&nbsp;</td>
  85. <td class="darkBg"><div align="center" class="title">Login</div></td>
  86. <td class="tr">&nbsp;</td>
  87. </tr>
  88. <tr>
  89. <td class="lightBg">&nbsp;</td>
  90. <td class="lightBg">
  91. <form name="form1" method="post" action="">
  92. <p>&nbsp;</p>
  93. <p align="center"><span class="titles">
  94. Your Email: </span>
  95.  
  96. <input name="email" type="text" id="email" size="30">
  97. </p>
  98. <p align="center"> <span class="titles">
  99. Password: </span>
  100.  
  101. <input name="pwd" type="password" id="pwd">
  102. </p>
  103. <p align="center">
  104. <input type="submit" name="Submit" value="Login">
  105. </p>
  106. <p align="center"><a href="register.php">Register</a> | <a href="forgot.php">Forgot</a></p>
  107. </form>
  108. </td>
  109.  
  110. <td class="lightBg">&nbsp;</td>
  111. </tr>
  112. <tr>
  113. <td class="bl">&nbsp;</td>
  114. <td class="lightBg">&nbsp;</td>
  115. <td class="br">&nbsp;</td>
  116. </tr>
  117. </table>
  118.  
  119. </td>
  120. </tr>
  121. </table>
  122. </body>
  123. </html>
Add Comment
Please, Sign In to add comment