Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page_title = "Members Area";
- include("includes/header.inc.php");
- print_r($_SESSION);
- ///check to see if we are logging in
- if (isset($_POST['username'])) {
- $username = $_REQUEST['username'];
- $password = $_REQUEST['password'];
- //
- $sql = "SELECT id FROM customer_details WHERE email_address='".$username."' AND password ='".$password."'";
- $res = mysql_query($sql,$connection) or die(mysql_error());
- if (mysql_num_rows($res) == 0)
- {
- echo "Wrong Username or password!";
- }
- else
- {
- $row = mysql_fetch_assoc($res);
- $my_id = $row['id'];
- echo "Welcome";
- ///login sucessfull show members page
- $_SESSION['my_id'] = $my_id;
- }
- if (!isset($_SESSION['my_id'])) {
- $login_form='
- <center>
- <table border="0">
- <form method="POST" action="'.$_SERVER["PHP_SELF"].'">
- <tr>
- <td>Email</td><td><input type="text" name="username" size="20" value="'.$_COOKIE["user"].'" /></td>
- </tr>
- <tr>
- <td>Password</td><td><input type="password" name="password" size="20" value="'.$_COOKIE["passw"].'" /></td>
- </tr>
- <tr>
- <td></td>
- <td><input class="button" type="submit" value="Login"></td>
- </form>
- </table>
- </center>
- ';
- }
- else
- {
- $login_form='';
- }
- //set up vars
- ?>
- <div id="under_top">
- <h1>Site under construction</h1>
- </div>
- <?php include("includes/links_advertising.inc.php"); ?>
- <h1>Members Area</h1>
- <?php echo $login_form; ?>
- <?php include("includes/footer.inc.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement