Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include_once"config.php";
- if(!isset($_SESSION['username']) || !isset($_SESSION['password']))
- if(isset($_POST['login'])){
- $username= trim($_POST['username']);
- $password = trim($_POST['password']);
- if($username == NULL OR $password == NULL){
- $final_report.="Please complete all the fields below..";
- }else{
- $check_user_data = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error());
- if(mysql_num_rows($check_user_data) == 0){
- $final_report.="This username does not exist..";
- }else{
- $get_user_data = mysql_fetch_array($check_user_data);
- if($get_user_data['password'] == $password){
- $start_idsess = $_SESSION['username'] = "".$get_user_data['username']."";
- $start_passsess = $_SESSION['password'] = "".$get_user_data['password']."";
- $final_report.= header("Location:") ;
- }}}}
- $fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_SESSION['username']."'"));
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>ScriptWebs | Making the Impossible Possible</title>
- <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
- <link rel="stylesheet" type="text/css" href="css/style.css" />
- </head>
- <body>
- <div id="wrapper"><br><br>
- <div id="logo">
- <img src='images/sw_logo.png' width='850' height='145' alt='ScriptWebs | Making the Impossible Possible'>
- </div>
- <div id="nar">
-
- </div>
- <div id="header"><br><Br>
- <a href='#' class='button'>Home</a> <a href='#' class='button'>Forums</a> <a href='#' class='button'>Chat</a> <a href='#' class='button'>Contact</a> <?php if ($_SESSION){ ?><? echo "".$fetch_users_data->username.""; ?> Welcome back.<?php }else { ?> <a href='#' class='button'>Login</a> <a href='#' class='button'>Register</a><?php } ?>
- </div>
- <div id="nar">
-
- </div>
- <div id="content">
- <?php if ($_SESSION){ include 'chat_file/index.php'; } ?>
- </div>
- <div id="nar">
-
- </div>
- <div id="footer">
- <p>This is the Footer</p>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment