hjkhhjhjol;io;ioio;ioiio;ioreererereio;;iooi;i;o;oii;o;ioo;iio;oi;
bnmbnmbnmnbmbio;io;irererereeo;o;oi;;oi;oioi;oi;oio;;oovn
/
home
/
u174022924
/
domains
/
rockonwheelstravels.in
/
public_html
/
Upload FileeE
HOME
<?php session_start(); include 'include/config.php'; if(isset($_POST['contact'])){ $contact=$_POST['contact']; $query="SELECT * FROM users WHERE contact='$contact'"; $res=mysqli_query($db,$query); $num=mysqli_num_rows($res); if($num>=1){ $api_key = '56065F6C5D2D08'; $from = 'LOLOCB'; $contact = $_POST['contact']; $otp=''; $otp=rand(111111,999999); $sms_text = "Dear Customer, ".$otp."is your one time password (OTP) - Lolo Cab"; $template_id = '1207162418064197453'; //Submit to server $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, "http://sms.creativedigitalinfotech.com/app/smsapi/index.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "key=".$api_key."&campaign=30&routeid=30&type=text&contacts=".$contact."&senderid=".$from."&msg=".$sms_text."&template_id=".$template_id); curl_exec($ch); curl_close($ch); $sql = "UPDATE users SET otp = '$otp' WHERE contact='$contact'"; if ($db->query($sql)) { echo "Success"; } else { echo "Something Wrong"; } } else{ $add = "INSERT INTO users(contact,otp) VALUES('$contact','$otp')"; if ($db->query($add)) { echo "Success"; } else { echo "Something Wrong"; } } } if(isset($_POST['verify_otp'])){ $otp=$_POST['verify_otp']; $sql="SELECT * FROM users WHERE otp='$otp'"; $res=$db->query($sql); if($res->num_rows > 0) { // $row = $res->fetch_assoc(); while($row = $res->fetch_assoc()) { $_SESSION['session_id']=$row['id']; $_SESSION['login_user']=$row['name']; } echo "verified"; }else{ echo "failed"; } } ?>