did u give proper username and password to login with?
On 10/12/05, twistednetadmin <[EMAIL PROTECTED]> wrote:
> I'm new to this. So I used a tutorial to write this. But it shows "Login
> ok.
> Welcome" at once when the page loads. Here is the tutorial:
> http://www.ss32.x10hosting.com/ss32/files/PHP-logins.pdf
> include ("DBconnection");
>
>
> session_start();
> $err = 0;
> echo $err; //just to check. Shows 0
> $sql_login = sprintf("SELECT 'name', 'pass' FROM DB
> WHERE 'name'='%s' AND 'pass'='%s'", @$_GET['name'],@md5($_GET['pass']));
> $login = mysql_query($sql_login) or die(mysql_error());
> if (mysql_num_rows($login) == 0) {
> $GLOBALS['MM_username'] == @$_GET['name'];
> echo $err; //just to check. Shows 0
> session_register("MM_username");
> echo $err; //just to check. Shows 0
> $err = 1;
>
>
> }
> echo $err; //just to check. Shows 1
> ?>
>
> if ($err != 1) {
> if ($err == 2) { ?>
> There was an error processing your login.
>
>
>
>
>
>
> Login as:
>
>
>
>
> Password:
>
>
>
>
>
>
>
>
>
> }else{
> ?>
> Login ok. Welcome echo "";
> }
> ?>
>
> I don't get any further. I must be missing something, but what??
>
> Please help.
>
> -Tore W-
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php