umcsendsms.php

来自「它是一个和平台无关的sms发送软件。对于手机开发的人员很有用。 SMS-Man」· PHP 代码 · 共 104 行

PHP
104
字号
<?php// This file is part of SMS Man project.//// SMS Man is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// SMS Man is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with SMS Man; if not, write to the Free Software// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USArequire_once('HTTP/Client.php');require_once('HTTP/Request/Listener.php');class UMC_SMS_Sender{	var $_umc_url = "http://www.umc.ua";	var $_send_page = "umc_sendsms_u_pict.php";	var $_http_client;	var $_session_id = "";	var $_image_file = "tmp/UMC_Code.gif";	var $_pnm_file = "tmp/UMC_Code.pnm";	var $_umc_code = "";	function UMC_SMS_Sender()	{		$this->_http_client = &new HTTP_Client();	}		function sendSMS($number, $message, $sender)	{		$this->_http_client->reset();		$this->_getSessionID();		$this->_savePicture();		$this->_gifToPnm();		$this->_recognizeCode();		$data = array(			'network1' => "UMC",			'Phone1' => $number,			'network2' => "UMC",			'Phone2' => "",			'network3' => "UMC",			'Phone3' => "",			'Message' => $message,			'sender_name' => $sender,			'anti' => $this->_umc_code,			'l' => 'ukr',			'PHPSESSID' => $this->_session_id		);		$this->_http_client->post($this->_umc_url."/misc/sendsms.php", $data);				$this->_http_client->reset();	}		function &_getSessionID()	{		$page = "/umc_sendsms_u.php";		$this->_http_client->get($this->_umc_url.$page);		$responce = $this->_http_client->currentResponse();		preg_match("<img src=\"".$this->_send_page."\?PHPSESSID=(.*)\" align=\"middle\">",			   $responce['body'], $out);		$this->_session_id = $out[1];	}	function &_savePicture()	{		$pic_url = $this->_umc_url."/".$this->_send_page."?PHPSESSID=".$this->_session_id;				$this->_http_client->get($pic_url);				$responce = $this->_http_client->currentResponse();				$image = imagecreatefromstring($responce['body']);		imagegif($image, $this->_image_file);		imagedestroy($image);	}		function &_gifToPnm()	{		exec("giftopnm ".$this->_image_file." > ".$this->_pnm_file);	}		function &_recognizeCode()	{		$this->_umc_code = exec("gocr -C \"0123456789\" -i ".$this->_pnm_file);	}}//$sender = &new UMC_SMS_Sender();//$sender->sendSMS("XXXXXXX", "Hello!", "Sender");?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?