class controller extends CI_Controller {
public function
__construct() {
parent::__construct();
$this->load->library('session');
$this->load->library('curl');
$this->load->helper(array('url', 'form'));
}
public function callingurl()
{
$get_url = 'http://stackoverflow.com/questions/ask';
echo $this->curl->simple_get($get_url, false, array(CURLOPT_USERAGENT => true));
}
}
您正试图访问访问SSL证书的HTTPS协议。所以让你的代码成为…
public function callingurl()
{
$get_url = 'https://www.google.com';
$this->curl->ssl(FALSE); // making the ssl certificate to false;
echo $this->curl->simple_get($get_url, false, array(CURLOPT_USERAGENT => true));
}
$baseurl = "http://promo.blastsms.in/sendsms.jsp?";
$user = "xxxxx";
$password = "xxxxx";
$api_id = "xxxxx";
$url="$baseurl/&user=$user&password=$password&mobiles=$to&sms=$text&senderid=$api_id&version=$version";
通过这种方式,我拆分了我的url。