PHP Classes

File: views/api/updateImageLinks.php

Recommend this page to a friend!
  Classes of Hillary Kollan   Scopr   views/api/updateImageLinks.php   Download  
File: views/api/updateImageLinks.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Scopr
Crawl and search Web site pages, images and news
Author: By
Last change:
Date: 1 year ago
Size: 704 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__."/../../config.php";
require_once
SITE_ROOT."/controllers/SearchController.php";
require_once
SITE_ROOT."/controllers/helpers/Headers.php";
$send = new SearchController();
$cross = new Headers();
if (
$_SERVER['REQUEST_METHOD'] === 'POST') {
   
// The request is using the POST method
   
foreach($cross->cross_origin() as $key => $value){
        echo
$value;
    }
    if(isset(
$_POST['url'])){
       
        echo
$send->sendImageClick($_POST);
    }else{
       
header("Content-type: application/json");
        echo
json_encode(["error"=>"No url"]);
    }
}else{
   
header("Content-type: application/json");
    echo
json_encode(["error"=>"Invalid request type"]);
}