View Single Post
Old 11-16-2012, 11:26 AM   PM User | #13
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
I can not trouble shot your machine from my desk. You have to do it.

Oh I see. Don't you look at what I give you? I spotted the problem right away. My code is connecting to my database and SELECTING from my database using my columns. Your login.php should be:
Code:
 <?php
session_start();
if(isset($_SESSION['uname']))
  unset($_SESSION['uname']);

include_once('conndb1.php');


    $username = mysql_real_escape_string($_POST["name"]);
    $password = mysql_real_escape_string(md5($_POST["pass"]));


    $sql =("SELECT username from clan_members where password='$password' AND username='$username'");
    $res = mysql_query($sql)or die(mysql_error());
    $row = mysql_fetch_row($res);
    if($row[0] == $username)
    {
        $_SESSION["uname"] = $username;
        echo 'Logged In <button id="continue" onclick="window.location.href = \'continue.php\';">Continue</button>';
    }
        if($row[0] != $username)
    {
        echo 'Name or password incorrect<br>Try again';
    }
?>
sunfighter is online now   Reply With Quote
Users who have thanked sunfighter for this post:
prash91 (11-16-2012)