Re: Session variables does not get sent

From: Date: Mon, 06 Sep 2004 00:13:37 +0000
Subject: Re: Session variables does not get sent
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-195954@lists.php.net to get a copy of this message
Dre wrote: <snip>
if((empty($_POST['user_name'])) || (empty($_POST['password']))) { header('Location: index.php'); include("login_form"); exit(); }
That include is useless, as you're forwarding to another document right before it.
else{ include("db.php"); $sql = "SELECT * FROM members_webdata WHERE user_name='".$username."' AND password='".$pass."'"; $result = mysql_query($sql); $num_return = mysql_num_rows($result); if($num_return ==1) {
    $row = mysql_fetch_array($result);
$_SESSION['uname'] = $row['user_name'];
Are you sure $row['user_name'] has value? -- By-Tor.com It's all about the Rush http://www.by-tor.com

« previous php.general (#195954) next »