<?php 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 (isset($val['email']) == $_POST['email']) {
if (isset($val['email']) == $_POST['password']) {
echo 'successful login!';
} else {
echo 'wrong password';
}
$emailFound = TRUE;
break;
}
}
if ($emailFound === FALSE) {
echo 'wrong email';
}
}
}
?>
Array
(
[59a7ff3f9bdca] => Array
(
[email] => savav@sacasv
[email verification] => 0
[password] => asvasv
)
[59a7fffb25b58] => Array
(
[License] => Array
(
[LicenseKeyName1] => Array
(
[Name] => LicenseKeyName1
[license key] => 59ad4d90549e9
[license key date] => 2018-09-04
)
[LicenseKeyName2] => Array
(
[Name] => LicenseKeyName2
[license key] => 59ad4d9c3d2b8
[license key date] => 2018-09-04
)
[LicenseKeyName3] => Array
(
[Name] => LicenseKeyName3
[license key] => 59ad4da362256
[license key date] => 2018-09-04
)
[LicenseKeyName4] => Array
(
[Name] => LicenseKeyName4
[license key] => 59ae84efb3dbc
[license key date] => 2018-09-05
)
)
[email] => anna.lavrova95@mail.ru
[email verification] => 1
[password] => 123456
)
[59a80007578bd] => Array
(
[email] => ascasc@ascavasv
[email verification] => 0
[password] => asvvsaavs
)
[License] => Array
(
[LicenseKeyName1] => Array
(
[Name] => LicenseKeyName1
[license key] => 59ad4d71d2bb3
[license key date] => 2018-09-04
)
)
)