General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 27th, 2004, 04:46 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 117 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 29 sec
Reputation Power: 6
login prob

Hi guys,

can u guys take a look at my login code ?? previously it worked when i enter valid password and username,, but now it seems like only one username and password can login.. when other valid password and usernames are entered, they wun able to access main page.... is it my code problem or session problem (where i didn't destroy the session properly ??)

e,g:
login with id = haha, pw=hehe <- can access
login with id = keke, pw=koko <- sometimes can access but sometimes can't even the username and password is in the db,,

my code:

* Edit: Please enclose all code within the proper code tags *
PHP Code:
<?
session_start
();
header ("cache-control/:private");

include_once 
"include/db.php";

//$username = $_POST['username'];
//$password = $_POST['password'];

if((!$username) || (!$password))
{
    echo 
'Please enter a valid usename and pasword before proceed';
    include 
'shop_login.php';
    exit();
}

$sql mysql_query("SELECT * FROM `info` WHERE `username`='$username' AND `password`='$password'") or die(mysql_error());
//$login_check = mysql_num_rows($sql);

if(mysql_num_rows($sql)>0){
while (
$row mysql_fetch_array($sql))
{
//session_register('username');
$_SESSION['username'] = $username;
$last $row['last_login'];
//session_register('last');
$_SESSION['last'] = $last;
$status $row['status'];
//session_register('$status');
$_SESSION['status'] = $status;
mysql_query("

Reply With Quote
  #2  
Old January 27th, 2004, 11:37 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Why'd you comment these lines?

Code:
//$username = $_POST['username'];
//$password = $_POST['password'];

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > login prob


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT