How to improve sql query security using php?
| From: | Richard Creech | Date: | Sat, 30 Sep 2000 09:11:29 +0000 |
| Subject: | How to improve sql query security using php? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18155@lists.php.net to get a copy of this message | ||
Hi All,
Great list!
I have a simple html form which accepts an email address and password.
I run this query:
SELECT $emailfield, $passwordfield FROM $userstable WHERE $emailfield = '$loginemail'
but what if the user enters the character "%@%", or other nasty things for the variable
called $loginemail? I understand client side Javascript can be easily defeated, and that a LIMIT 1
will work -but not in other queries - which is what I will need. I don't want crackers piping
out my complete data set. I need to get a better handle on this security issue. What's the BEST
thing I can do here to improve my sql security using php?
Regards,
Richard Creech
http://dreamriver.com
richardc@dreamriver.com
Phone 250.744.3350 Pacific Time