PHP Classes

File: ajax/report.php

Recommend this page to a friend!
  Classes of Ákos Nikházy   PHP Have I Been Pwned API Search   ajax/report.php   Download  
File: ajax/report.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Have I Been Pwned API Search
Check if email addresses are in the HIBP database
Author: By
Last change: Update of ajax/report.php
Date: 1 year ago
Size: 543 bytes
 

Contents

Class file image Download
<?php
/*
    report.php - read a report
   
    This software created by Ákos Nikházy

*/
session_start();

require_once(
'../req/settings.php');

header('Content-Type: application/json');

if(empty(
$_SERVER['HTTP_X_REQUESTED_WITH']))
    exit(
json_encode(array('status' => 'error')));

if(
$passwordProtection && !isset($_SESSION['login']))
{
       
    exit(
json_encode(array('status' => 'error')));
   
}

if(isset(
$_GET['file']))
{
   
    exit(
json_encode(file_get_contents('../reports/' . $_GET['file'])));
   
}

exit(
json_encode(array('status' => 'error')));
?>