if(isset($_POST['password']))
{
echo "";
// Execute the SQL query
$email=$_POST['email'];
$password=md5($_POST['password']);
// $query=mysqli_query($conn,"select ID, FullName, Email, MobileNumber, dias, area from tbluser, area where Email='$email' && Password='$password' ");
$sql = "SELECT ID, FullName, Email, MobileNumber, dias, area from tbluser, area where Email='$email' && Password='$password' FROM tbluser";
$result = $conn->query($sql);
echo "";
if ($result->num_rows > 0) {
// Output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["ID"]. " - Name: " . $row["FullName"]. " " . $row["area"]. "
";
$area=$row["area"];
$usuario=$row["ID"];
}
} else {
echo "0 results";
}
}
$datos = fopen("variables.txt", "a");
fwrite($datos, $area . "\n \n" );
fwrite($datos, $usuario . "\n \n");
fclose($datos);
// $ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['id_usuario']=htmlententies($_POST['ID']);
$_SESSION['nombre']=htmlententies($_POST['nombre']);
$_SESSION['correo']=htmlententies($_POST['correo']);
$_SESSION['numero']=$ret['MobileNumber'];
$_SESSION['area'] = htmlententies($_POST['area']);
$user=$_POST['ID'];
$area=$_POST['area'];
}
// setcookie('user',$zona, time() + (86400 * 30), "/");
// setcokies('id', $idd);
function mejora()
{
//echo $AR;
// header('location:dashboard.php');
// header('location: dashboard/dist/index.html');
// header('location:navbar.php');
}
?>