DB Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

SELECT * FROM `user` the_table WHERE the_table.userid = DB Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

SELECT * FROM `user` the_table WHERE the_table.userid = PHP and MySQL login routine security question? - iTechForums
Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 1
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2008, 10:01 AM
Dunder Mifflin Dunder Mifflin is offline
Junior Member
 
Join Date: May 2008
Posts: 1
Default

PHP and MySQL login routine security question?


I found this account login code online:

<?php
require_once('connect.php');
$email = mysql_escape_string(trim(stripslashes($_...

if (!empty($email)) {
$query = "SELECT username, password FROM members WHERE email = '$email'";
$result = mysql_query($query);
while ($row = mysql_fetch_object($result)) {
$username = $row->username;
$password = $row->password;
}
echo "Your username is $username";
echo "Your password is $password";
}
else {
echo "Please enter your email address!";
}

?>

My question is, isn't this very unsafe since if a malicious user does a little digging and finds a user's email address, they can pretty much get their password or am I incorrect? I have a mysql db and and trying to develop a secure php front end with user login. I haven't found any that use hashing algorythms.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Question! Need an answer quick!? Vinn-E MySQL 0 05-13-2008 08:14 AM
I have been trying to change my security key for dcinternational2000@yahoo.com for Dontae C Security 0 05-08-2008 08:08 AM
Login and Log Out / Username PHP script? MySQL? Piano playing Doctor PHP 2 05-06-2008 08:47 PM
Is the security is one of reason for using http and scripting languages... mai h Web Scripts 1 05-06-2008 12:30 PM
tried login yahoo mail but i was told its a login error due to object... twinkle JavaScript 4 05-06-2008 10:25 AM

Your Ad Here

All times are GMT. The time now is 09:58 AM.