View Single Post
Old 02-07-2008, 04:48 PM   #9 (permalink)
flyingbuddha
The Contributor
 
flyingbuddha's Avatar
 
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
flyingbuddha is on a distinguished road
Default

Quote:
Originally Posted by xperience View Post
I'm pretty sure it's a bad idea to SELECT * when just verifying a username and a password. I would just SELECT the fields you need that way there is no way someone could gain access to a password.

PHP Code:
$query mysql_query("SELECT rank FROM `cms` WHERE `username` = '".$_POST['username']."' AND `password` = '".$_POST['password']."'"); 
Or you could select all and unset password if you're that way inclined.

PHP Code:
<?php
// ...
unset($row['password']);
?>
Hopefully you wouldn't be storing plaintext password's in the first place though ;)
__________________
Pro. Geek
http://www.mikeholloway.co.uk
flyingbuddha is offline  
Reply With Quote
The Following User Says Thank You to flyingbuddha For This Useful Post:
codefreek (02-08-2008)