Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-19-2006, 10:40 PM   PM User | #1
RawliJr
Regular Coder

 
Join Date: May 2006
Location: Canada
Posts: 195
Thanks: 0
Thanked 0 Times in 0 Posts
RawliJr is an unknown quantity at this point
Cool Login help?

PHP Code:
<? 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 and i dont know why that is?


Cheers
Rawli
__________________
Rawli
RawliJr is offline   Reply With Quote
Old 06-19-2006, 10:57 PM   PM User | #2
RawliJr
Regular Coder

 
Join Date: May 2006
Location: Canada
Posts: 195
Thanks: 0
Thanked 0 Times in 0 Posts
RawliJr is an unknown quantity at this point
lol, i got it lol.....simple mistake

Code:
    exit(); 
} 

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

should of been

Code:
    exit(); 
} 

$_SESSION['user_id'] = $user['id']; 
header( 'Location: http://thugkillin.urlshort.com/base.php' ); 
?>
</center> 
</body>
?> was in the worng place lol
__________________
Rawli
RawliJr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:34 AM.


Advertisement
Log in to turn off these ads.