Re: still having login problems sigh

From: Date: Thu, 25 Mar 2004 07:44:28 +0000
Subject: Re: still having login problems sigh
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-181453@lists.php.net to get a copy of this message
Hi, On Wed, 24 Mar 2004 23:59:30 -0500 aborka1@wmis.net (Andy B) wrote: > hi... > > still having login problems.. > i tried just about everything i can think of to get this to > work but for some strange reason it keeps getting stuck... What do mean by "keeps getting stuck"? Where? What? Any error messages? > [code] > <? > session_start(); > include("libs/conf.db"); > > mysql_connect($host, $mysqluser, $mysqlpwd); > $result=mysql_query("select * from rnjresort.users where > username='$username' and pwd=md5('$password')"); Where's $username coming from? $_GET? $_POST? Check the manual/archives for more info... > if(mysql_num_rows($result)==0) { > echo "<h1>Login failed</h1>"; > header("location: login.html"); } > else { > $_SESSION[username]=$username; > header("location: deletepost.php"); } > ?> > [/code] Use an absolute URL for header("Location ... And, your "echo" shouldn't come before your "header". Again, you can check the manual/archives for more info... And, maybe there's something else, I didn't really check everything :) -- - E -

« previous php.general (#181453) next »