Jump to content

LiTe

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Posts posted by LiTe

  1. 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.

  2. 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";
    	}
    }
    }

  3. 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.