Beispiel #1
0
     msetcookie('08cms_msgcode', authcode("{$timestamp}\t{$msgcode}", 'ENCODE'));
     $info = array('time' => -1, 'text' => str_replace('%s', $msgcode, $msgcode_msg));
 } elseif ($msgcode_mode == 2) {
     list($inittime, $initcode) = maddslashes(explode("\t", @authcode($m_cookie['08cms_msgcode'], 'DECODE')), 1);
     if ($timestamp - $inittime > 60) {
         $msg = str_replace('%s', $msgcode, $msgcode_sms);
         if ($mcharset != 'gbk' || $mcharset != 'gb2312') {
             include M_ROOT . 'include/charset.fun.php';
             $msg = convert_encoding($mcharset, 'gb2312', $msg);
         }
         $msg = rawurlencode($msg);
         $url = $msgcode_gate == 1 ? "http://sms.eshang8.cn/api/?esname={$id}&key=pw&phone={$mobile}&msg={$msg}&smskind=1" : "http://service.winic.org/sys_port/gateway/?id={$id}&pwd={$pw}&to={$mobile}&content={$msg}&time={$timestamp}";
         include M_ROOT . 'include/http.cls.php';
         $http = new http();
         $http->timeout = 60;
         $msg = $http->fetchtext($url);
         if ($msgcode_gate == 1) {
             $msg = $msg === '0';
         } else {
             $msg = explode("/", $msg);
             $msg = $msg[0] === '000';
         }
         if ($msg) {
             msetcookie('08cms_msgcode', authcode("{$timestamp}\t{$msgcode}", 'ENCODE'));
         } else {
             $info = array('time' => -1, 'text' => 'msgcode_send_err');
         }
     } else {
         $info = array('time' => 1, 'text' => 'donot_repeat_operate');
     }
 }
Beispiel #2
0
 function onepage($url)
 {
     global $mcharset, $progress;
     $m_http = new http();
     $m_http->timeout = $this->gmission['timeout'] ? $this->gmission['timeout'] : 0xffff;
     if ($this->gmission['mcookies']) {
         $m_http->setCookies($this->gmission['mcookies']);
     }
     $html = $m_http->fetchtext($url);
     unset($m_http);
     $html = convert_encoding($this->gmission['mcharset'], $mcharset, $html);
     $this->clean_blank($html);
     $progress && $progress->pagecount(1);
     return $html;
 }