Commit c3cbd8a2 authored by Andrew's avatar Andrew

ip added

parent 706d1e09
......@@ -2,8 +2,10 @@
define('INDEX', 'index');
if($_SERVER['REQUEST_URI']=='/dsp')
require("pages/dsp.php");
elseif($_SERVER['REQUEST_URI']=='/ndsp')
else if(preg_match("/^\/ndsp\?/", $_SERVER['REQUEST_URI']))
require("pages/ndsp.php");
else if(preg_match("/^\/go\?/", $_SERVER['REQUEST_URI']))
require("pages/go.php");
else if(preg_match("/^\/tgo\?/", $_SERVER['REQUEST_URI']))
......
......@@ -591,10 +591,18 @@ array (
),
);
$q=parse_url($_SERVER['REQUEST_URI'])["query"];
parse_str($q,$_GET);
$ip=ip2long($_GET['ip']);
if(!$ip)
die;
$res=array();
foreach ($goods as $ads) {
$ad=$ads[mt_rand(1,10000)%sizeof($ads)];
$data=$ad['data'][mt_rand(1,10000)%sizeof($ad['data'])];
$data=$ad['data'][$ip%sizeof($ad['data'])];
unset($ad['data']);
$ad['price']=str_replace('${price}', $data['price'], $ad['price']);
$ad['ad_id'].="_".$data['l_path'];
......
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