$manageGroup = 'Choujiang'; $promotePositionArr = rGetPromotePositionArr('goods'); $categoryArr = rGetCategoryArr(); $pindaoArr = rGetPindaoArr(); $dopost = isset($_POST['dopost']) ? $_POST['dopost'] : ''; $numIid = isset($_POST['numIid']) ? trim($_POST['numIid']) : ''; //提交过来的num_iid $createMessage = ''; if ($dopost == 'caiji') { if ($numIid != "" && rRuleNum($numIid)) { include dirname(__FILE__) . '/../../uaj_taobao_json.php'; $createMessage = '采集进行中,请稍等........'; if (CAIJITYPE == 'KEY') { $getcon = keycaiji($numIid); } else { $getcon = GetPtaobao(array('uid' => $numIid, 'cj' => 1, 'hos' => $Zbk_user_host), 'pitem'); } $getcon = json_decode($getcon, TRUE); if (empty($getcon['item']['nick'][0])) { $createMessage = '不存在这个商品'; } else { $detail_url = $getcon['item']['detail_url'][0]; $num_iid = $getcon['item']['num_iid'][0]; $title = $getcon['item']['title'][0]; $nick = $getcon['item']['nick'][0]; $pic_url = $getcon['item']['pic_url'][0]; $num = $getcon['item']['num'][0]; $price = $getcon['item']['oldprice'][0]; $freight_payer = $getcon['item']['auction_point'][0]; $item_imgs = $getcon['item']['pic_url'][0]; $createMessage = '采集成功';
<?php include dirname(__FILE__) . '/include/Sysvers.php'; function GetPtaobao($data = array(), $file) { global $zhuanbaokehost; $pch = curl_init(); curl_setopt($pch, CURLOPT_URL, $zhuanbaokehost . '/curl/' . $file . '.php'); curl_setopt($pch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($pch, CURLOPT_TIMEOUT, 12); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($pch, CURLOPT_POSTFIELDS, http_build_query($data)); $pcontents = curl_exec($pch); curl_close($pch); return $pcontents; } if (isset($_POST['u'])) { $u = trim($_POST['u']); if ($u != "") { $getcon = GetPtaobao(array('uid' => $u, 'cj' => 1, 'hos' => $Zbk_user_host), 'shop'); echo $getcon; exit; } else { $arry["id"] = 0; $arry["msg"] = "采集超时或者不存在这个店铺"; echo json_encode($arry); exit; } }