Jump to content

LiTe

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LiTe's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Update: I remove this code and the sessions work..: $count = mysql_num_rows(mysql_query("SELECT * FROM `Users` WHERE `account`='$_POST[username]'")); if ($count == 0) { $_SESSION['Login']="BAD"; }
  2. can't edit because button is junk, I put echo $_SESSION['Login'] . "<br>" . $_SESSION['Username'] . "<br>" . $_SESSION['Hash']; at the bottom and top of the index.php when I login, it's all correct seems there is no reason it would be losing the session, but when I go to any other page it loses it.
  3. The only page that has any session code is the index.php.
  4. which code? has a lot of code read what I said in the first post, I gave you the code that don't work and the code that does work
  5. There is an index.php and all the links go ?cat=(link) in index.php.
  6. I'm implementing MD5 hashing for my login but the sessions keep dying when I navigate to a different page. My old code works fine when navigating. The new script logs in fine but just loses the session after going to a different link. //----------------------------NEW LOGIN SCRIPT------------------------ if ($_GET['Login'] == "True") { $count = mysql_num_rows(mysql_query("SELECT * FROM `Users` WHERE `account`='$_POST[username]'")); if ($count == 0) { //$count will either be a 0 (user don't exist) or a 1 (user exists), no duplicate accounts $_SESSION['Login']="BAD"; } if (isset($_POST['Username']) && isset($_POST['Password'])) { $query = "SELECT account, active, salt, password FROM `Users` WHERE `account`='" . $_POST['Username'] . "'"; $result = mysql_query($query); while($r=mysql_fetch_array($result)) { $cPass = $r['password']; if ($r['active'] == "0") { session_destroy(); die("User is disabled"); } $cSalt = $r['salt']; $oPass = $_POST['Password'] . $cSalt; if (md5($oPass) == $r['password']) { $_SESSION['Username'] = $_POST['Username']; $_SESSION['Hash'] = md5("$oPass"); $_SESSION['Login']="GOOD"; } else { $_SESSION['Login']="BAD"; } } } } //----------------------------OLD LOGIN SCRIPT------------------------ if ($_GET['Login'] == "True") { $count = mysql_num_rows(mysql_query("SELECT * FROM `Users` WHERE `active`='1' AND `account`='" . $_POST['Username'] . "' AND `password`='" . $_POST['Password'] . "'")); if ($count == "1") { $_SESSION['Login']="GOOD"; $_SESSION['Username']=$_POST['Username']; } else { if (isset($_POST['Username']) || isset($_POST['Password'])) { $_SESSION['Login']="BAD"; } } }
  7. How do you show an "Image not found" image when someone links to an image with img tag? Is this htaccess? My host is http://1and1.com Thanks, LiTe
  8. I'm getting no errors at all..
  9. Your english is bad. How come my IP is used on the internet: Every IP address is UNIQUE on every network connection. It identifies your router/computer on the internet.
  10. I made an affiliates page (one page) with PHP that current has view affiliates, admin (ADD / REMOVE) and right now I'm trying to add clicks/hits. I have it adding the clicks to SQL database but I can't get it to forward/redirect to the website. WEBSITE is stored in $GoTo and does work.   $GoTo = $row['url'];   echo "$GoTo"; Tried:   header('Location: $GoTo');   header("Location: $GoTo");   header('Location: http://asf.com'); They don't work, please help!
×
×
  • 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.