Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://daily-flyer-srl-69f86.firebaseio.com/Admin
resulted in a 404 Not Found
#545
-
hello, Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: if (isset($_POST['Login']))
{
$email = $_POST['admin_email'];
$loginstatus=0;
$pass = $_POST['admin_password'];
if($email != '' && $pass != '')
{
$user =$auth->signInWithEmailAndPassword($email, $pass);
if($user)
{
$ref="Admin/";
$udata=$database->getReference($ref)->getValue();
if ($udata)
{
#products loop
foreach ($udata as $key => $userdata)
{
if ($userdata)
{
#now get values
$uemail=$userdata['Email'];
if($email==$uemail)
{
#set session variables and break out of loop
$loginstatus=1;
$_SESSION['user_id']= $key;
$_SESSION['username']=$userdata['Name'];
$_SESSION['user_email']=$userdata['Email'];
header("Location:dashboard.php");
}
}
}
if ($loginstatus==0)
{
#set error message user is not admin
header("Location:index.php");
}
}
else
{
#show error messsage user is not admin
header("Location:index.php");
}
}
else
{
#show error messsage user is not registered or user details incorrect
header("Location:index.php");
}
}
else
{
#show error user details are empty
header("Location: index.php");
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi 👋! I edited your post for readability (code formatting). Please check at https://console.firebase.google.com/project/_/database/ for the name of your database (it's the URL that looks like If it's not $factory = (new Factory)
->withServiceAccount('path/to/your/service_account.json')
->withDatabaseUri('<URL from your Firebase console>');
$database = $factory->createDatabase(); |
Beta Was this translation helpful? Give feedback.
Hi 👋! I edited your post for readability (code formatting).
Please check at https://console.firebase.google.com/project/_/database/ for the name of your database (it's the URL that looks like
https://<some string>.firebaseio.com
.If it's not
https://daily-flyer-srl-69f86.firebaseio.com
(this is the default URL generated from the SDK based on the project ID of your project), please use thewithDatabaseUri()
method on the factory: