php 發送sms執行個體代碼_PHP教程

來源:互聯網
上載者:User


SMS Web Sender Demo


SMS Web Sender DEMO!

if ($action != "submit") {
?>

Any username or password you enter here will not be stored
in any way (although we're not using SSL either)

Also, as you can see most of these are UK sites, not all
of them will support international numbers!

} else {

// contains the site details
include("sites.php");

// contains main class
include("class.sms_web_sender.php");

if (empty($number) || empty($site) || empty($message)) {
die("Make sure number, site and message are not empty");
}

if (!empty($debug) && $debug == "yes") {
$debug = true;
} else {
$debug = false;
}

// signature bit of text that's required by some
// sites like MTNSMS.com, you can leave as is
$signature = "*";

// create instance of sms web sender the one
// optional argument will determine if
// debug is turned on or not
$sms = new sms_web_sender($debug);

// add accounts
// 1st argument: username
// 2nd argument: password
// 3rd argument: server
// 4th argument: weight (this is only useful when
// shuffling the logins, the higher
// the weight, the more likely it'll
// be placed near the top of the list)
// default if left blank: 1
$sms->add_login("$user", "$pass", "$site");

// add Proxy Server details if required
// I haven't tested this myself, feature of jm_sms
//$sms->setProxyServer("proxyserver");
//$sms->setProxyPort(81);
//$sms->setProxyUser("proxyusername");
//$sms->setProxyPass("proxypassword");
//$sms->setProxy(true);

// passes the number, signature and message in an array
$result = $sms->send_sms(array("number"=>$number, "signature"=>$signature, "message"=>$message));

if ($result) {
echo "

Sent!

";
} else {
echo "

Could not send :(

";
echo "

Go Back

";
}

}

?>



http://www.bkjia.com/PHPjc/445003.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445003.htmlTechArticlehtml head titleSMS Web Sender Demo/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FFFFFF text=#000000 h2SMS Web Sender DEMO!/h2 ?php i...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.