Jump to content

Can anyone make me this?


aznjay

Recommended Posts

[code]
$blah2 = $_POST['user'];
$blah = $_POST['pass'];
$something=date("F j, Y");

$result = mysql_query("SELECT * FROM users WHERE username = '" . $blah2 . "' AND password = '" . $blah . "'");

$co = 0;while($r = mysql_fetch_array($result))
{
$co ++;
$item_name = $r["item_name"];
$item_id = $r["item_id"];
}
if($co != 0)
{
print "error you dumbass, wrong password and or username!";
} else
{

echo "$item_name";

}
[/code]

Okay what I'm trying to do is to check if there is user in the database but it seem to be not work...so yeah can anyone make me a new script or fix this one?
Link to comment
Share on other sites

[code=php:0]$user = $_POST['user'];
$pass = $_POST['pass'];
$something=date("F j, Y");

$user = mysql_real_escape_string(urldecode($user));
$pass = mysql_real_escape_string(urldecode($pass));

$result = mysql_query("SELECT * FROM users WHERE username = '" . $user . "' AND password = '" . $pass . "'") or die(mysql_error());

$co = 0;
while($r = mysql_fetch_array($result))
{
$co ++;
$db_user = $r['username'];
$db_pass = $r['password'];
}
if($co != 0)
{
print "error you dumbass, wrong password and or username!";
} else
{

echo "$db_user password correct";

}[/code]


Hope that helps :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.