Re: Session variables does not get sent
| From: | Dre | Date: | Mon, 06 Sep 2004 00:06:43 +0000 |
| Subject: | Re: Session variables does not get sent | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-195955@lists.php.net to get a copy of this message | ||
yes I'm sure
"John Nichel" <jnichel@by-tor.com> wrote in message
news:413BABB1.6000500@by-tor.com...
> 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