Strange $_POST behaviour?!
Posted: Sun May 23, 2010 5:44 pm
I have saved following code by login.php name and put that file on a server. But the problem is whenever I run the file it shows ''success!" allways. Why so? I can't understand.. Please help...
Code: Select all
<?php
$con = mysql_connect("localhost","s_admin","habijabi");
mysql_select_db("aluvhaji",$con);
//Receive form data
$uname = $_POST["titl"];
$pword = $_POST["desc"];
$value = mysql_query("select * from user where username = '$uname' and password='$pword'",$con);
if($value)
{
echo "success!";
}
else die('Error: ' . mysql_error());
?>