我有两台服务器:
1。许可
2。供应
现在客户端(android / ios设备)向许可证服务器发送请求。所以我们从 GET 中获取了一些参数,我想使用CURL将其转发到Provisioning服务器。
此代码位于许可证服务器上
$skey = $this->input->get('site_id');
$uid = $this->input->get('user_id');
$url = "http://127.0.0.1/provisioning/customer/provisioning?site_key=".$skey."&uid=".$uid;
$wget_cmd = "wget --no-check-certificate \"".$url."\" >/dev/null 2>/dev/null ";
//echo($wget_cmd);
//exec($wget_cmd);
// create a new cURL resource
$ch = curl_init();
//curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
echo curl_error($ch);
// close cURL resource, and free up system resources
curl_close($ch);
在配置服务器如何访问这些变量?:
$skey = $this->input->get('site_id');
$uid = $this->input->get('user_id');
我不想在屏幕上回显它们我只是想将它们用于其他数据库交易。