PHP Classes

File: views/api/updateLink.php

Recommend this page to a friend!
  Classes of Hillary Kollan   Scopr   views/api/updateLink.php   Download  
File: views/api/updateLink.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: 728 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']) && isset($_POST['id'])){
       
        echo
$send->sendClick($_POST);
    }else{
       
header("Content-type: application/json");
        echo
json_encode(["error"=>"No url or id"]);
    }
}else{
   
header("Content-type: application/json");
    echo
json_encode(["error"=>"Invalid request type"]);
}