Guest User

Untitled

a guest
Sep 2nd, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.74 KB | None | 0 0
  1.     <?php
  2.     session_start();
  3.     include_once"config.php";
  4.     if(!isset($_SESSION['username']) || !isset($_SESSION['password']))
  5.    
  6.         if(isset($_POST['login'])){
  7.         $username= trim($_POST['username']);
  8.         $password = trim($_POST['password']);
  9.     if($username == NULL OR $password == NULL){
  10.         $final_report.="Please complete all the fields below..";
  11.     }else{
  12.         $check_user_data = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error());
  13.     if(mysql_num_rows($check_user_data) == 0){
  14.         $final_report.="This username does not exist..";
  15.     }else{
  16.         $get_user_data = mysql_fetch_array($check_user_data);
  17.     if($get_user_data['password'] == $password){
  18.         $start_idsess = $_SESSION['username'] = "".$get_user_data['username']."";
  19.         $start_passsess = $_SESSION['password'] = "".$get_user_data['password']."";
  20.         $final_report.= header("Location:") ;
  21.     }}}}
  22.     $fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_SESSION['username']."'"));
  23.     ?>
  24.  
  25. <!DOCTYPE html>
  26. <html>
  27. <head>
  28. <title>ScriptWebs | Making the Impossible Possible</title>
  29. <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  30. <link rel="stylesheet" type="text/css" href="css/style.css" />
  31. </head>
  32. <body>
  33.     <div id="wrapper"><br><br>
  34.         <div id="logo">
  35.         <img src='images/sw_logo.png' width='850' height='145' alt='ScriptWebs | Making the Impossible Possible'>
  36.         </div>
  37.         <div id="nar">
  38.         &nbsp;
  39.         </div>
  40.         <div id="header"><br><Br>
  41.             &nbsp;<a href='#' class='button'>Home</a>&nbsp;&nbsp;<a href='#' class='button'>Forums</a>&nbsp;&nbsp;<a href='#' class='button'>Chat</a>&nbsp;&nbsp;<a href='#' class='button'>Contact</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if ($_SESSION){ ?><? echo "".$fetch_users_data->username.""; ?> Welcome back.<?php }else { ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' class='button'>Login</a>&nbsp;&nbsp;<a href='#' class='button'>Register</a><?php } ?>
  42.         </div>
  43.         <div id="nar">
  44.         &nbsp;
  45.         </div>
  46.         <div id="content">
  47.         <?php if ($_SESSION){ include 'chat_file/index.php'; } ?>  
  48.         </div>
  49.         <div id="nar">
  50.         &nbsp;
  51.         </div>
  52.         <div id="footer">
  53.             <p>This is the Footer</p>
  54.         </div>
  55.     </div>
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment