function GetParam() { $Get = getReq($_REQUEST, array('action' => 'string', 'type' => 'string', 'nid' => 'int', 'page' => 'int', 'stime' => 'int')); if ($Get['type'] == 'content') { $Get = array_merge($Get, getReq($_REQUEST, array('total' => 'int', 'pagesize' => 'int', 'cmode' => 'int', 'action' => 'string'))); //采集内容 每页采集数、间隔时间 if (empty($Get['pagesize'])) { $Get['pagesize'] = 1; } //if(empty($Get['stime'])) $Get['stime']=3; } //if($Get['action']=='real'){$Get['stime']=$_GET['stime'];} return $Get; }
function GetParam() { $Get = getReq($_REQUEST, array('len' => 'int', 'cid' => 'int', 'status' => 'int', 'keyword' => 'string', 'type' => 'string', 'order' => 'string')); $Get['keyword'] = urldecode(trim($Get['keyword'])); return $Get; }
/** * 自定义栏目分类转换 接收查询参数 */ function ChannelSearch() { if (!empty($_POST['search'])) { $Get = getReq($_REQUEST, array('cname' => 'string', 'reid' => 'int', 'nid' => 'int')); foreach ($Get as $k => $v) { if (!empty($v)) { $Param[$k] = trim($v); } } return $Param; } }
public function processRequest() { $return['result'] = 'fail'; $return['id'] = intval(getReq("custom", 0)); $payment = NULL; if ($return['id']) { $payment = Payments::model()->findByPk($return['id']); } if (!$return['id'] || !$payment) { logs('paypal not find payment'); return $return; } $get_magic_quotes_exists = false; if (function_exists('get_magic_quotes_gpc')) { $get_magic_quotes_exists = true; } $postdata = ""; foreach ($_POST as $key => $value) { if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { $value = urlencode(stripslashes($value)); } else { $value = urlencode($value); } $postdata .= "&{$key}={$value}"; } $sGatewayURL = $this->mode == Paysystem::MODE_TEST ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr'; $postdata .= "cmd=_notify-validate"; $curl = curl_init($sGatewayURL); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($curl, CURLOPT_HTTPHEADER, array('Connection: Close', 'User-Agent: ' . $this->email)); $response = curl_exec($curl); curl_close($curl); if ($response != "VERIFIED") { logs("TRANSACTION_NOT_VERIFIED"); logs($response); logs($_POST); return $return; } if (strtolower($_POST['receiver_email']) != $this->email) { logs("INVALID_RECEIVER"); logs($_POST); return $return; } if ($_POST["txn_type"] != "web_accept") { logs("INVALID_TRANSACTION_TYPE"); logs($_POST); return $return; } $payment_status = Yii::app()->request->getParam('payment_status'); if ($payment_status == "Completed" || $payment_status == "Pending") { $return['result'] = 'success'; // } elseif($payment_status == "Pending") { // $return['result'] = 'pending'; // $return['pending_reason'] = getReq('pending_reason'); } else { $return['result'] = 'fail'; } return $return; }