In this code I'm trying to get it setup so that if the $uname and $upass are not blank it will execute the if statement otherwise it'll go to the else. right no nomatter what it goes to the if. I echoed the vars in the if statement and they are blank, but it will still follow the if..
<?php
$conn = mysql_connect("localhost", "xxxxxx", "xxxxx");
mysql_select_db("xxxx_login", $conn);
$uname = $_POST['name'];
$upass = $_POST['password'];
if (isset($uname) && isset($upass)) {
echo "-->".$_POST['name']."<----
";
echo "-->".$_POST['password']."<----";
$sql = "select name, password from logins where name = '$uname'";
$result = mysql_query($sql) or die (mysql_error());
extract(mysql_fetch_assoc($result));
if ($password == $_POST["password"]) {
header ("Location: http://www.jza2000.com/");
}} else {
echo "sorry wrong username or password";
}
?>
<?php
$conn = mysql_connect("localhost", "xxxxxx", "xxxxx");
mysql_select_db("xxxx_login", $conn);
$uname = $_POST['name'];
$upass = $_POST['password'];
if (isset($uname) && isset($upass)) {
echo "-->".$_POST['name']."<----
";
echo "-->".$_POST['password']."<----";
$sql = "select name, password from logins where name = '$uname'";
$result = mysql_query($sql) or die (mysql_error());
extract(mysql_fetch_assoc($result));
if ($password == $_POST["password"]) {
header ("Location: http://www.jza2000.com/");
}} else {
echo "sorry wrong username or password";
}
?>