本文整理汇总了PHP中sms::send_authcode方法的典型用法代码示例。如果您正苦于以下问题:PHP sms::send_authcode方法的具体用法?PHP sms::send_authcode怎么用?PHP sms::send_authcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sms
的用法示例。
在下文中一共展示了sms::send_authcode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db
} else {
if (isset($_POST['mobile']) && isset($_POST['email'])) {
include_once root_dir . "classes/db.class.php";
$dbh = new db();
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$dbh->select("users", "id", "mobile='{$mobile}' AND email='{$email}'", "none", "none");
if ($dbh->sel_count_row < 1) {
$dbh->select("tmp_users", "id, first_name, activation_code", "mobile='{$mobile}' AND email='{$email}'", "none", "none");
if ($dbh->sel_count_row > 0) {
$reg_id = $dbh->select_res['id'];
$fname = $dbh->select_res['first_name'];
$code = $dbh->select_res['activation_code'];
include_once root_dir . "classes/sms.class.php";
$sms = new sms();
$res = $sms->send_authcode($mobile, $fname, $code);
// print_r($res);
if ($res['type'] == 'success') {
header("Location:" . root_dir . "account_activation.php?reg_id=" . $reg_id . "&&time=2&msg=SMS with activation code has been sent to your mobile (" . $mobile . "). Please enter this code to activate your a/c.!&msg_clr=green");
exit;
} else {
header("Location:" . root_dir . "account_activation.php?msg=It may Take some time to deliver SMS to your number or something wrong with your no. Try later!&msg_clr=red");
exit;
}
} else {
header("Location:" . root_dir . "account_activation.php?msg=This Mobile No. and Email do not registered yet, Please register first to play Game!&msg_clr=red");
exit;
}
} else {
header("Location:" . root_dir . "account_activation.php?msg=Your a/c already registered. Please login to Play Game.&msg_clr=green");
exit;
示例2: db
<?php
if (isset($_GET['mobile'])) {
$mobile = $_GET['mobile'];
include_once "../classes/db.class.php";
$dbh = new db();
$dbh->select("registration", "fname, lname, auth_code", "mobile='{$mobile}'", "none", "1");
if ($dbh->sel_count_row > 0) {
if ($dbh->select_res['auth_code'] == "") {
$auth_code = substr(time(), 6);
$dbh->update("registration", "auth_code='{$auth_code}'", "mobile='{$mobile}'", "none", "1");
} else {
$auth_code = $dbh->select_res['auth_code'];
}
$name = ucfirst($dbh->select_res['fname']) . ' ' . ucfirst($dbh->select_res['lname']);
include_once "../classes/sms.class.php";
$sms = new sms();
$sms->send_authcode($mobile, $name, $auth_code);
header("Location:../authentication-page.php?msg=Authentication code send again to your mobile no. " . $mobile . ". Please activate now! &msg_clr=green&mobile=" . $mobile);
exit;
} else {
header("Location:../authentication-page.php?msg=The Mmobile no. " . $mobile . " is not registered yet. Please register first.! &msg_clr=red&mobile=" . $mobile);
exit;
}
} else {
echo "Some error! Try again later.";
}