Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-15-2005, 03:57 PM Case?
Extreme Talker

Posts: 219
Location: UK, East Anglia
Trades: 0
How do i make logging into my site case-sensitive? At the moment say if the username in mysql is 'Tim', and someone tries to log in with the username 'tim' it will let them.
timsquash5 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-15-2005, 05:37 PM
Novice Talker

Posts: 8
Trades: 0
Hi,

When your SQL queries the username and/or password values, I'm pretty sure your script does something along the lines of:

Code:
// assuming $_POST[username] is the field for hte username of the login form
$query = mysql_query("SELECT username FROM table WHERE username LIKE \"$_POST[username]\"");
It should use the equal = sign instead of LIKE keyword.

Code:
$query = mysql_query("SELECT username FROM table WHERE username=\"$_POST[username]\"");
I'm thinking this is the case one way or another. Obviously it won't be exactly the same, but this gives me a hunch. Hope this helps.
Herman Chen is offline
Reply With Quote
View Public Profile
 
Old 03-15-2005, 06:24 PM
Experienced Talker

Posts: 36
Trades: 0
I found this for you. Although doing this for a login system will create more problems than it will solve.
tress is offline
Reply With Quote
View Public Profile
 
Old 03-16-2005, 11:25 AM
Extreme Talker

Posts: 219
Location: UK, East Anglia
Trades: 0
Thank you, it took me a while but i found it, you have to use something like this:

PHP Code:
SELECT Name FROM users WHERE BINARY Name="Tim" 
timsquash5 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Case?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53178 seconds with 12 queries