$uid = $this->msgconfig ['sms'] ['user4']; // 分配给你的账号
$pwd = $this->msgconfig ['sms'] ['pass4']; // 密码
$content2 = $this->content;
$content = rawurlencode ( $this->content ); // 短信内容
$phonelist = array ();
if (stripos ( $this->mob, ',' ) > - 1) {
$phonelist = explode ( ',', $this->mob );
} else {
$phonelist [0] = $this->mob;
}
$agent = $_SERVER ['HTTP_USER_AGENT'];
$borwser_type = getBrowser ( $agent );
$client_os = getPlatform ( $agent );
$ip = get_client_ip ();
$ipinfo = get_ip_location_area ( $ip );
foreach ( $phonelist as $key => $value ) {
$data = array (
'phone' => $value,
'content' => $content2,
'ip' => $ip,
'ipinfo' => $ipinfo,
'add_time' => time (),
'borwser_info' => $agent,
'type' => 1,
'borwser_type' => $borwser_type,
'client_os' => $client_os
);
$smsid = $this->logmodel->add ( $data );
logg_r($this->logmodel->sql());
$post_data = '&account=' . $uid . '&password=' . $pwd . '&mobile=' . $value . '&content=' . $content;
$smsdata = curl_get_contents ( $this->target . $post_data );
$json = xml_to_array ( $smsdata );
$json = $json ['SubmitResult'];
$smsid = $this->data ['smsid'];
if ($smsid >> 0) {
$updata = array (
'result' => $json ['code'],
'msg' => $json ['msg']
);
$this->logmodel->where ( 'id=' . $smsid )->save ( $updata );
}
}保存数据库的时候,保存不了,我跟踪代码到了db驱动,有sql,但是就是不执行,求助
ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。