mercredi 21 octobre 2015

What would be the best way to keep a balance current in a $_Session variable

I have this small script at the top of a page. i want the page to redirect if the balance is 0, if it is not 0 id like the page its on to execute. As it is here , it ignores the if statement regardles if its true or not, and if i keep exit(); in nothing executes. Help me out guys

session_start(); include('../../includes/connection.php');

  $id=$_SESSION['id'];

  $select_query=@mysql_query("select balance from players_signup where     id=$id");
    $_SESSION['balance']=@mysql_result($select_query,0,'balance');
             //echo "$",$_SESSION['balance'],".00";

 $balance=$_SESSION['balance']; 

 if($balance<"1"){
 header('location:../../paypal/');
 exit();
 }
 ?>

Aucun commentaire:

Enregistrer un commentaire