This is a very simple and very basic php code..
pero bisag unsaon nako di man jud mo True ang 'if' statement.
unsay possible problem ani?
this is a very simple username and password authentication
++++++++++++++++++++++++++++++++++++++++++++++++++ +
<?php
$con=mysql_connect("localhost", "root", "") or die(mysql_error());
$db=mysql_select_db("user", $con) or die(mysql_error());
$user=$_POST['user'];
$pass=$_POST['pass'];
$query=('SELECT * FROM USERS WHERE (USERNAME = "$user" and PASSWORD = "$pass")');
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
$username = $row['USERNAME'];
$password = $row['PASSWORD'];
}
if($username==$user and $password == $pass)
{
include('home.html');
}
else
{
echo"FAILED TO LOGIN!";
}
?>
any thoughts? please help