i'm having the same error.
i cant use the vars defined in a include
the code is
Code:
include '../includes/functions.php';
if (isset($_POST['usuario']) && isset($_POST['senha'])) {
$con = mysql_connect("$mysql_host","$mysql_user","$mysql_password");
$db = mysql_select_db($mysql_database,$con);
if($db) {
$user = $_POST['usuario'];
$query = mysql_query("SELECT user, hash FROM siteuser WHERE user='".$user."'");
if ($query) {
while ($result = mysql_fetch_row($query)) {
if($result[0]=$_POST['usuario']) {
$hash = md5(md5($_POST['senha']));
if ($result[1]=$hash) {
login();
break;
} else {
header("Location: login.php?msg=Dados+Incorretos");
break;
}
}
}
} else {
header("Location: login.php?msg=Dados+Incorretos");
}
}
} else {
header("Location: login.php?msg=Dados+Incorretos");
}
on the include functions.php there are the vars of the mysql and the function login().
the page is displaying the content of the include and its not recognizing the vars of the mysql for the connection