-
Notifications
You must be signed in to change notification settings - Fork 0
/
send-otp.php
28 lines (28 loc) · 1.3 KB
/
send-otp.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
<?php
session_start();
$OTP=rand(100000,999999);
$mobile = $_POST["contact"];
$message="Welcome to Foodle.\n".$OTP." is your OTP to signup.";
$json = json_decode(file_get_contents("https://smsapi.engineeringtgr.com/send/?Mobile=9930157621&Password=Foodle123&Message=".urlencode($message)."&To=".urlencode($mobile)."&Key=foodlsxK2qeznrW8DNELIvZo1B5F") ,true);
if ($json["status"]=="success") {
$_SESSION['otp'] = $OTP;
$_SESSION['contact'] = $mobile;
header('Location: contact.php');
}else{
$json = json_decode(file_get_contents("https://smsapi.engineeringtgr.com/send/?Mobile=8668463938&Password=Foodle123&Message=".urlencode($message)."&To=".urlencode($mobile)."&Key=harshc1Vaz8kfiOrFdpNwhJ") ,true);
if ($json["status"]=="success") {
$_SESSION['otp'] = $OTP;
$_SESSION['contact'] = $mobile;
header('Location: contact.php');
}else{
$json = json_decode(file_get_contents("https://smsapi.engineeringtgr.com/send/?Mobile=8412941419&Password=Foodle123&Message=".urlencode($message)."&To=".urlencode($mobile)."&Key=harshu0h7RFIHTbrCUpjw") ,true);
if ($json["status"]=="success") {
$_SESSION['otp'] = $OTP;
$_SESSION['contact'] = $mobile;
header('Location: contact.php');
}else{
echo "OTP not sent. Try later.";
}
}
}
?>