Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AT THE TOP OF THE PAGE//
- <?
- session_start();
- include_once"config.php";
- if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
- header("Location: login.php");
- }else{
- if(isset($_POST['login'])){
- $username= trim($_POST['username']);
- $password = trim($_POST['password']);
- if($username == NULL OR $password == NULL){
- $final_report.="Please complete both fields";
- }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.="<meta http-equiv='Refresh' content='0; URL=members.php'/>";
- }}}}}
- ?>
- //THE HTML FORM//
- <form action="" method="post">
- <p>
- <input type="text" title="username" name="username" class="username" value="Username" onclick="if ( value == 'Username' ) { value = ''; }"/>
- <input name="password" type="password" class="password" title="password" value="Password" onclick="if ( value == 'Password' ) { value = ''; }"/>
- <input type="Submit" name="login" class="submit" value="login" tabindex="3" />
- </p>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement