...

View Full Version : Login help?



RawliJr
06-19-2006, 10:40 PM
<? ob_start(); ?>
<html>
<head>
<title>ThugKillin</title>
</head>
<body>
<center><img src="/images/THUGKILLIN.jpg" border="0" width="444" /></a></center>
<body bgcolor="#000" text="white">
<center>
<?

if( empty($_POST['username']) || empty($_POST['password']) )
{
echo 'Invalid username/password try again';

exit();
}

if( !preg_match('/^[a-z][a-z0-9_-]{3,31}$/i', $_POST['username']) || (strlen($_POST['password']) < 6) )

{
echo 'Invalid username/password try again!';
exit();
}

mysql_connect( 'localhost', 'xxx', 'xxx' );
mysql_select_db( 'xxx' );

$result = mysql_query( "SELECT id FROM users WHERE username='{$_POST['username']}' AND password='{$_POST['password']}'" );
$user = mysql_fetch_assoc( $result );
mysql_free_result( $result );

mysql_close();

if( empty($user) )
{
echo 'Invalid username/password try again!';
exit();
}

$_SESSION['user_id'] = $user['id'];
?>
header( 'Location: http://thugkillin.urlshort.com/base.php' );
</center>
</body>
</html>


ok , it wont take me to my BASE (http://www.thugkillin.urlshort.com/base.php) and i dont know why that is?


Cheers
Rawli:thumbsup:

RawliJr
06-19-2006, 10:57 PM
lol, i got it lol.....simple mistake


exit();
}

$_SESSION['user_id'] = $user['id'];
?>
header( 'Location: http://thugkillin.urlshort.com/base.php' );
</center>
</body>
</html>


should of been


exit();
}

$_SESSION['user_id'] = $user['id'];
header( 'Location: http://thugkillin.urlshort.com/base.php' );
?>
</center>
</body>

?> was in the worng place lol



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum