Jump to content

Letterbomb05

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by Letterbomb05

  1. really need help, PLEASE someone help me sort this out >_>
  2. still does the same as before: <?php session_start(); // database information $dbhost = ""; $dbname = ""; $dbuser = ""; $dbpass = ""; // connect to database mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); // retrieve form input $username = htmlentities(mysql_real_escape_string($_POST['username'])); $password = (md5($_POST['password'])); // query the database $query = "SELECT * from users WHERE username='$username' and password='$password'"; $result = mysql_query($query); $aAssoc = mysql_fetch_assoc($result); $rank = $qAssoc['rank']; if(mysql_num_rows($result) === 0 || $qAssoc['rank'] == 0){ include('incorrect.php'); }else{ if ( $rank == 1 ) { $SESSION['registered'] = true; } if ( $rank == 2 ) { $SESSION['member'] = true; } if ( $rank == 3 ) { $SESSION['moderator'] = true; } if ( $rank == 4 ) { $SESSION['admin'] = true; } header("Location:http://www.team-recoil.com/newtemplate/info.php"); } // end of script ?>
  3. lol @ that first one, I'm sorry I'm tired and I always miss small little things like that. I'll edit this post in a sec and see if there is any progress.
  4. Is that all thats wrong..? I mean i have session_start() on all other pages
  5. Hello, I really need this Login Script completed, and I haven't got it working in the past 5 days, and I'm getting very frustrated!!! My problems are: A) As far as I'm aware, the SESSION doesn't get set B) When I login with the correct details, all that really happens is the page gets refreshed, I don't get take to info.php or anything! PLEASE HELP! Code: <?php // start of login script // database information $dbhost = "localhost"; $dbname = ""; $dbuser = ""; $dbpass = ""; // connect to database mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); // start session session_start(); // retrieve form input $username = htmlentities(mysql_real_escape_string($_POST['username'])); $password = (md5($_POST['password'])); // query the database $query = "SELECT * from users WHERE username='$username' and password='$password'"; $result = mysql_query($query); $aAssoc = mysql_fetch_assoc($result); $rank = $qAssoc['rank']; if(mysql_num_rows($result) === 0 || $aAssoc['rank'] == 0){ include('incorrect.php'); }else{ if($rank = 1){ $SESSION['registered'] = true; } if($rank = 2){ $SESSION['member'] = true; } if($rank = 3){ $SESSION['moderator'] = true; } if($rank = 4){ $SESSION['admin'] = true; } header("Location: info.php"); } // end of script ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.