-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsms_send.php
39 lines (36 loc) · 831 Bytes
/
sms_send.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
include_once("inc_config.php");
if(isset($_POST['mobile']))
{
$mobile = $validation->input_validate($_POST['mobile']);
if(preg_match('/^\d{10}$/',$mobile))
{
$mobile = $mobile;
}
else
{
echo "Failed";
}
$rand_no = rand(10000, 99999);
$dupresult2 = $db->check_duplicates('rb_registrations', 'regid', $regid, 'mobile', strtolower($mobile), "insert");
if($dupresult2 >= 1)
{
echo "existed";
exit();
}
$recipient_no = $mobile;
$message = "$rand_no is your OTP and it is valid for the next 10 minutes. Please do not share this OTP with anyone. Thank You, Grocery Master.";
$send = $api->sendSMS('GROMAS', $recipient_no, $message,'1007161787364887137');
if($send)
{
echo "Done";
}
else
{
echo "Failed";
}
$_SESSION['verification_code'] = $rand_no;
$_SESSION['mobile'] = $mobile;
exit();
}
?>