( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
function getApiBrandIdentity() {
// Implement basic authentication (e.g., using a token)
$authToken = 'f4c3b9a2e6d1c5e0a8f1b2c3d4e5f6g7'; // Define a secure token
/*if (!isset($_SERVER['HTTP_AUTHORIZATION']) || $_SERVER['HTTP_AUTHORIZATION'] !== 'Bearer ' . $authToken) {
header('HTTP/1.1 401 Unauthorized');
echo json_encode(['error' => 'Unauthorized access']);
exit;
}*/
// Check if the HTTP_REFERER header is set
if (!isset($_SERVER['HTTP_REFERER'])) {
// echo 'Access Denied!';
exit;
}
// Check if the HTTP_REFERER header is present and matches the domain of your website
/* if (!$_SERVER['HTTP_REFERER'] || !strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
// The request is not coming from the same domain, reject it
header('HTTP/1.1 403 Forbidden');
exit;
}*/
include('../../Connections/videoondemand.php');
// Database configuration
$host = $DBHost; // Your database host
$dbname = $DBName; // Your database name
$username = $DBUser; // Your database username
$password = $DBPassword; // Your database password
$userData = $_GET['snapshot'];
$userid = $_POST['name'];
if(empty($userid)){ echo 'Access Denied!';
exit;}
try {
// Create a new PDO instance
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Check for existing empty ID with status = 1
$stmt = $pdo->prepare("SELECT catalogname,name,phone,user_email,website,creator,type FROM lovelybrands WHERE catalogid = '$userid' LIMIT 1");
$stmt->execute();
// Fetch the result
$existingId =$stmt->fetch(PDO::FETCH_ASSOC);
if ($existingId) {
// If an empty ID exists, return it
$catalogname = $existingId['catalogname'];
$name = $existingId['name'];
$phone = $existingId['phone'];
$user_email =$existingId['user_email'];
$website =$existingId['website'];
$creator =$existingId['creator'];
$type =$existingId['type'];
}
} catch (PDOException $e) {
echo "Error: " . $e->getMessage();
}
// Enter Your API Keys Here
$apiDesign = array(
'catalogname'=> $catalogname,
'name' => $name,
'phone' => $phone,
'user_email' =>$user_email,
'website' =>$website,
'creator' =>$creator,
'type' =>$type,
);
$apiDesign = json_encode($apiDesign);
// Return the API keys
echo $apiDesign;
}
getApiBrandIdentity();
?>