?? umcsendsms.php
字號:
<?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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -