Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>
- Deals Admin
- </title>
- <link href="css/index.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <?php
- include 'dbcAddUser.php';
- $user_email = mysql_real_escape_string($_POST['email']);
- if ($_POST['Submit']=='Login')
- {
- $md5pass = md5($_POST['pwd']);
- $sql = "SELECT id,user_email,table_name FROM users WHERE
- user_email = '$user_email' AND
- user_pwd = '$md5pass' AND user_activated='1'";
- $result = mysql_query($sql) or die (mysql_error());
- $num = mysql_num_rows($result);
- if ( $num != 0 ) {
- // A matching row was found - the user is authenticated.
- session_start();
- list($user_id,$user_email,$table_name) = mysql_fetch_row($result);
- // this sets variables in the session
- $_SESSION['user']= $user_email;
- $_SESSION['table_name']= $result['table_name'];
- if (isset($_GET['ret']) && !empty($_GET['ret']))
- {
- header("Location: $_GET[ret]");
- } else
- {
- $secondCon = include ('dbcAddRows.php');
- if (!$secondCon) { echo "error on second con"; exit(); } else {
- $check = mysql_query ("SELECT * FROM `ricmetalstergmailcom` LIMIT 0,1");
- //".$_SESSION['table_name']."
- if ($check){
- echo "table exists";
- echo $_SESSION['table_name'];
- }else{
- echo $_SESSION['table_name'];
- echo "table doesnt exist";
- }
- exit();
- //header("Location: myaccount.php");
- }
- }
- //echo "Logged in...";
- exit();
- }
- header("Location: index.php?msg=Invalid Login");
- //echo "Error:";
- exit();
- }
- ?>
- <?php if (isset($_GET['msg'])) { echo "<div class=\"msg\"> $_GET[msg] </div>"; } ?>
- <p> </p>
- <table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr><td>
- <table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tl"> </td>
- <td class="darkBg"><div align="center" class="title">Login</div></td>
- <td class="tr"> </td>
- </tr>
- <tr>
- <td class="lightBg"> </td>
- <td class="lightBg">
- <form name="form1" method="post" action="">
- <p> </p>
- <p align="center"><span class="titles">
- Your Email: </span>
- <input name="email" type="text" id="email" size="30">
- </p>
- <p align="center"> <span class="titles">
- Password: </span>
- <input name="pwd" type="password" id="pwd">
- </p>
- <p align="center">
- <input type="submit" name="Submit" value="Login">
- </p>
- <p align="center"><a href="register.php">Register</a> | <a href="forgot.php">Forgot</a></p>
- </form>
- </td>
- <td class="lightBg"> </td>
- </tr>
- <tr>
- <td class="bl"> </td>
- <td class="lightBg"> </td>
- <td class="br"> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment