55 lines
958 B
PHP
55 lines
958 B
PHP
<?php header('Content-type: application/json');
|
|
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
|
|
|
include(PATHTOINCLUDES."base.php");
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
$em="";
|
|
|
|
|
|
|
|
$filters = array
|
|
|
|
(
|
|
|
|
"theadlink" => array
|
|
|
|
(
|
|
|
|
"filter"=>FILTER_SANITIZE_URL
|
|
|
|
),
|
|
|
|
"theadid" => array
|
|
|
|
(
|
|
|
|
"filter"=>FILTER_SANITIZE_NUMBER_INT
|
|
|
|
),
|
|
|
|
);
|
|
|
|
$result = filter_input_array(INPUT_GET, $filters);
|
|
|
|
$urlissue=0;
|
|
|
|
$headers = @get_headers($theadlink);
|
|
|
|
if(strpos($headers[0],'404')==true) {$urlissue=1;}
|
|
|
|
$adid=$_GET["theadid"];
|
|
|
|
$adlink=$_GET["theadlink"];
|
|
|
|
$sql="UPDATE `community_user_ads` SET `community_user_ads`.`thelink` = '".$adlink."' WHERE `community_user_ads`.`adid` = ".$adid." AND `community_user_ads`.`userid` = ".$_SESSION["cp_userid"];
|
|
|
|
$query=$database->database_query($sql) or $em=$em.$database->database_error();
|
|
|
|
$arr = array ('error' => $em);
|
|
|
|
echo json_encode($arr);
|
|
|
|
?>
|