redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS
<?php
session_start();
$error = '';
?>
<!--login-->
<?php
if (isset($_SESSION['USER_ID'])) {
header("Location:profile.php");
} elseif (!isset($_SESSION['USER_ID'])) {
if (isset($_POST['login'])) {
$json = $firebase->get(DEFAULT_PATH . "/ARCusers/");
$json_ary = json_decode($json, true);
$emailFound = FALSE;
if (is_array($json_ary) || is_object($json_ary)) {
foreach ($json_ary as $id => $val) {
if ($_POST['email'] == $val['email'] && $_POST['password'] == $val['password']) {
if ($val['email verification'] == 1) {
$_SESSION['USER_ID'] = $id;
header("Location:email_form.php");
} else {
$error = 'Account dose not active, activate email';
}
$emailFound = TRUE;
break;
}
}
if ($emailFound === FALSE) {
$error = 'wrong email or password';
}
}
}
}
?>