Commit d453e35b authored by Andrew's avatar Andrew

first

parents
<?
define('INDEX', 'index');
if($_SERVER['REQUEST_URI']=='/dsp')
require("pages/dsp.php");
else if(preg_match("/^\/go\?/", $_SERVER['REQUEST_URI']))
require("pages/go.php");
else if(preg_match("/^\/nurl\?/", $_SERVER['REQUEST_URI']))
require("pages/nurl.php");
else die("OK");
\ No newline at end of file
<?if(!defined('INDEX')) die;
$json=file_get_contents("php://input");
$data=json_decode($json, true);
if(!$data){
header("HTTP/1.0 204 No Content");
die;
}
$bid=array();
$bidid=1;
if(!isset($data['imp'])){
header("HTTP/1.0 204 No Content");
die;
}
foreach ($data['imp'] as $imp) {
$rnd=md5(rand().microtime());
$bid[]=array(
'id' => strval($bidid++),
'impid' => $imp['id'],
'price' => 0.18,
'nurl' => 'http://'.$_SERVER['HTTP_HOST'].'/nurl?i='.$rnd.'&z=${AUCTION_IMP_ID}&price=${AUCTION_PRICE}&b=1',
'adm' => '<a target="_blank" href="https://'.$_SERVER['HTTP_HOST'].'/go?i='.$rnd.'&z=${AUCTION_IMP_ID}&b=1"><img src="https://'.$_SERVER['HTTP_HOST'].'/static/b1.png" width="300px" height="600px" border="none"></a>',
'adid' => '1',
);
}
$resp = array(
'id' => $data['id'],
'seatbid' => array(
array(
'bid' => $bid
),
),
'cur' => 'USD',
'nbr' => 0,
);
header("Content-type: application/json");
echo json_encode($resp);
\ No newline at end of file
<?if(!defined('INDEX')) die;
$q=parse_url($_SERVER['REQUEST_URI'])["query"];
parse_str($q,$_GET);
$imp=$_GET['i'];
$z=intval($_GET['z']);
$b=intval($_GET['b']);
if(!$z|| !$b || !preg_match("/^([0-9a-f]{32})$/", $imp))
die;
error_log("imp=$imp||z=$z||b=$b\n",3,"go.log");
header("location: http://gillette.themag.com.ua/gl/?utm_source=$z&utm_campaign=$b");
die;
<?if(!defined('INDEX')) die;
$q=parse_url($_SERVER['REQUEST_URI'])["query"];
parse_str($q,$_GET);
$imp=$_GET['i'];
$z=intval($_GET['z']);
$b=intval($_GET['b']);
$price=floatval($_GET['price']);
if(!$z || !$b || !$price || !preg_match("/^([0-9a-f]{32})$/", $imp))
die;
error_log("imp=$imp||z=$z||b=$b||price=$price\n",3,"nurl.log");
header("HTTP/1.0 204 No Response");
die;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment