本文整理汇总了PHP中sms::login方法的典型用法代码示例。如果您正苦于以下问题:PHP sms::login方法的具体用法?PHP sms::login怎么用?PHP sms::login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sms
的用法示例。
在下文中一共展示了sms::login方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sms
<?php
error_reporting(E_ALL);
ob_implicit_flush(true);
include_once "class.curl.php";
include_once "class.sms.php";
include_once "cprint.php";
$smsapp = new sms();
$smsapp->setGateway('way2sms');
$myno = $_POST['fromno'];
$p = $_POST['pass'];
$tonum = $_POST['tono'];
$mess = $_POST['message'];
cprint("Logging in ..\n");
$ret = $smsapp->login($myno, $p);
if (!$ret) {
cprint("Error Logging In");
exit(1);
}
print "Logged in Successfully\n";
print "Sending SMS ..\n";
$ret = $smsapp->send($tonum, $mess);
if (!$ret) {
print "Error in sending message";
exit(1);
}
print "Message sent";
示例2: sms
<?php
error_reporting(E_ALL);
ob_implicit_flush(true);
//If you get Fatal error: Call to undefined function curl_init() , Then you need to enable the curl extension in php.ini
include_once "class.curl.php";
include_once "class.sms.php";
$smsapp = new sms();
$smsapp->setGateway('way2sms');
// you can set gateway to be '160by2' to use your 160by2 account;
echo "Logging in ... ";
$smsapp->login('919891508595', '123456');
echo "Sending SMS ... ";
$result = $smsapp->send('918287769888', 'my message');
if ($result == 'true') {
echo "Message sent";
} else {
echo "Error encountered : " . $smsapp->getLastError();
}