Indramayu IT Comunity
Path:
/
home
/
guruvidyaacademy
/
public_html
/
[
Home
]
File: otp.php
<?php include 'conn.php'; session_start(); $page = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $pagex = explode('/',$page); $chh=$pagex['4']; //echo $_SESSION['number']; if(isset($_POST['send_sms'])) { $mobile = mysqli_real_escape_string($con,$_POST['phone']); $otp_code1=rand(1111,9999); $_SESSION['otp_code']=$otp_code1; $Phone=$_POST['phone']; $_SESSION['number']=$_POST['phone']; $actual_linkuu = substr($_SERVER['HTTP_HOST'],4); $q=mysqli_query($con,"INSERT INTO `erp-enq_mob_ver`(`mobile`,`otp`,`staus`,`url`) VALUES ('$mobile','$otp_code1','no','".$actual_linkuu."')"); if($q>0) { $Text="Your one time password(OTP) is ".$otp_code1; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://control.msg91.com/api/sendotp.php?email=&template=&otp=".$otp_code1."&otp_length=&otp_expiry=&sender=GURUVD&message=".$Text."&mobile=".$Phone."&authkey=293597AOnZcgVOw5d78c048", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "", CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); unset($_SESSION['msggg']); $_SESSION['msggg']="Your OTP send to your given mobile number."; echo "<script> window.location.href='".$baseurl."/otp/otp_verification'; </script>"; } else { unset($_SESSION['msggg']); $_SESSION['msggg']="Mobile No All Ready Exits. Please Another No used."; echo "<script> window.location.href='".$baseurl."/otp'; </script>"; } } else if($chh=='resend' and $_SESSION['number']!=='') { $otp_code1=rand(1111,9999); $_SESSION['otp_code']=$otp_code1; if($_SESSION['counter']=='') { $_SESSION['counter']='2'; } else { $_SESSION['counter']='3'; } $Phone=$_SESSION['number']; //$actual_linkuu = substr($_SERVER['HTTP_HOST'],4); //$q=mysqli_query($con,"update set `choose_course_form_log`(`fname`, `lname`, `email`, `mobile`, `course`, `stream`,`otp`,`site`) VALUES ('$fname','$lname','$email','$Phone','$course','$stream','".$otp_code1."','".$actual_linkuu."')"); $Text="Your one time password(OTP) is ".$otp_code1; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://control.msg91.com/api/sendotp.php?email=&template=&otp=".$otp_code1."&otp_length=&otp_expiry=&sender=GURUVD&message=".$Text."&mobile=".$Phone."&authkey=293597AOnZcgVOw5d78c048", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "", CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); unset($_SESSION['msggg']); $_SESSION['msggg']="Your OTP send to your given mobile number"; echo "<script> window.location.href='".$baseurl."/otp/otp_verification'; </script>"; } else if(isset($_POST['verify'])) { if($_POST['otp']==$_SESSION['otp_code']) { $q=mysqli_query($con,"UPDATE `erp-enq_mob_ver` SET `staus`='yes' WHERE mobile='".$_SESSION['number']."'"); echo "<script> window.location.href='".$baseurl."/online-enquiry'; </script>"; } else { unset($_SESSION['msggg']); $_SESSION['msggg']="Invalid OTP Code. Enter Correct OTP Code."; echo "<script> window.location.href='".$baseurl."/otp/otp_verification'; </script>"; } } ?> <!DOCTYPE html> <html lang="zxx"> <head> <meta charset="utf-8"> <title>OTP Verification </title> <meta name="description" content="<?php echo $description[$offset];?>" /> <meta name="Keywords" content="<?php echo $Keywords[$offset];?>" /> <?php $ls1="SELECT * FROM home_page_header where id='1'"; $ls2=mysqli_query($con,$ls1); $ls=mysqli_fetch_array($ls2); $actual_link11 = substr($_SERVER['HTTP_HOST'],4); $web_url11=explode(',',$ls['web_url']); $key11 = array_search($actual_link11, $web_url11); $offset11 = array_search($key11, array_keys($web_url11)); $content11=explode('@@@@',$ls['content']); $meta_content11=explode('@@@@',$ls['meta_content']); echo $meta_content11[$offset11]; ?> <!-- responsive tag --> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- favicon --> <link rel="apple-touch-icon" href="apple-touch-icon.png"> <link rel="shortcut icon" type="image/x-icon" href="images/fav.png"> <!-- bootstrap v4 css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/bootstrap.min.css"> <!-- font-awesome css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/font-awesome.min.css"> <!-- animate css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/animate.css"> <!-- owl.carousel css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/owl.carousel.css"> <!-- slick css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/slick.css"> <!-- magnific popup css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/magnific-popup.css"> <!-- Offcanvas CSS --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/off-canvas.css"> <!-- flaticon css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/fonts/flaticon.css"> <!-- flaticon2 css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/fonts/fonts2/flaticon.css"> <!-- rsmenu CSS --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/rsmenu-main.css"> <!-- rsmenu transitions CSS --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/rsmenu-transitions.css"> <!-- style css --> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/style.css"> <link rel="stylesheet" type="text/css" href="<?php echo $baseurl ;?>/css/responsive.css"> <style> a.sdksb1 { display: none; } .form-control { display: block; width: 100%; padding: .375rem .75rem; font-size: 1rem; line-height: 2.0; color: #495057; background-color: #fff; background-clip: padding-box; border: 1px solid #ced4da; border-radius: .25rem; transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out; margin-bottom: 15px; } </style> </head> <body class="home1" style="background:#000;"> <!--Full width header Start--> <?php //include"header.php";?> <!--Full width header End--> <?php if($chh=='otp_verification') { ?> <div id="rs-about" class="rs-about " style="margin:0px;"> <div class="container" style="padding-bottom:80px;"> <div class="row" style="margin-top:100px;"> <div class="col-lg-3 col-md-12"> </div> <div class="col-lg-6 col-md-12 pb-70 mb-50 mt-30" style="background: #fff;padding: 30px;"> <h3 style="margin-bottom:5px; color:#000;">Verify OTP Code </h3> <form class="row search-form" method="post" action="#"> <div class="col-md-12"> <div class="keyword"> <input type="text" name="phone" class="form-control" value="<?php echo "******".substr($_SESSION['number'],-4);?>" disabled/> </div> </div> <div class="col-md-12"> <div class="keyword"> <input type="text" name="otp" class="form-control email" id="emailv" placeholder="Enter OTP Code" required/> </div> </div> <?php if($_SESSION['counter']!=='3') { ?> <div class="col-md-12" style="color:green;text-align: right;"> <p style="margin:0px;"><a href="<?php echo $baseurl;?>/otp/resend">Resend OTP Code</a></p> </div> <?php }?> <div class="col-md-12"> <div class="search-btn"> <p style="color: #1468b1; margin-bottom: 3px;"> <?php echo $_SESSION['msggg'] ;?></p> <button type="submit" name="verify" style="display: inline-block;text-decoration: none;background-color: #ff3115;color: #ffffff;font-weight: 500;min-width: 170px;line-height: 45px;height: 45px;text-align: center;text-transform: uppercase; border:none;">Verify </button> </div> </div> </form> </div> </div> </div> </div> </div> <?php } else { ?> <div id="rs-about" class="rs-about" style="margin:0px;"> <div class="container" style="padding-bottom:80px;"> <?php /*?><div class="sec-title text-center"> <h2>Enquery Form </h2> </div><?php */?> <div class="row" style="margin-top:100px;"> <div class="col-lg-3 col-md-12" > <?php /*?> <p align="center"><img src="http://www.guruvidyaonline.com/enquiry.png" alt="" style="width:300px;padding-top: 75px;" > </p> <?php */?> </div> <div class="col-lg-6 col-md-12 pb-70 mb-50 mt-30" style="background: #ffff;padding: 30px;"> <h3 style="margin-bottom:5px; color:#000;">Enter Mobile No. </h3> <form class="row search-form" method="post" action="#"> <div class="col-md-12"> <div class="keyword"> <input type="number" name="phone" class="form-control contactt" id="contactv" placeholder="Mobile No" required/> </div> </div> <div class="col-md-12"> <div class="search-btn"> <p style="color: #1468b1; margin-bottom: 3px;"> <?php echo $_SESSION['msggg'] ;?></p> <button type="submit" name="send_sms" style="display: inline-block;text-decoration: none;background-color: #ff3115;color: #ffffff;font-weight: 500;min-width: 170px;line-height: 45px;height: 45px;text-align: center;text-transform: uppercase; border:none;">Submit </button> </div> </div> </form> </div> </div> </div> </div> </div> <?php }?> <!-- Footer Start --> <?php //include"footer.php";?> <!-- Footer End --> <!-- start scrollUp --> <div id="scrollUp"> <i class="fa fa-angle-up"></i> </div> <!-- modernizr js --> <script src="<?php echo $baseurl ;?>/js/modernizr-2.8.3.min.js"></script> <!-- jquery latest version --> <script src="<?php echo $baseurl ;?>/js/jquery.min.js"></script> <!-- bootstrap js --> <script src="<?php echo $baseurl ;?>/js/bootstrap.min.js"></script> <!-- owl.carousel js --> <script src="<?php echo $baseurl ;?>/js/owl.carousel.min.js"></script> <!-- slick.min js --> <script src="<?php echo $baseurl ;?>/js/slick.min.js"></script> <!-- isotope.pkgd.min js --> <script src="<?php echo $baseurl ;?>/js/isotope.pkgd.min.js"></script> <!-- imagesloaded.pkgd.min js --> <script src="<?php echo $baseurl ;?>/js/imagesloaded.pkgd.min.js"></script> <!-- wow js --> <script src="<?php echo $baseurl ;?>/js/wow.min.js"></script> <!-- counter top js --> <script src="<?php echo $baseurl ;?>/js/waypoints.min.js"></script> <script src="<?php echo $baseurl ;?>/js/jquery.counterup.min.js"></script> <!-- magnific popup --> <script src="<?php echo $baseurl ;?>/js/jquery.magnific-popup.min.js"></script> <!-- rsmenu js --> <script src="<?php echo $baseurl ;?>/js/rsmenu-main.js"></script> <!-- plugins js --> <script src="<?php echo $baseurl ;?>/js/plugins.js"></script> <!-- main js --> <script src="<?php echo $baseurl ;?>/js/main.js"></script> <script type="text/javascript"> function fetch_select(val) { $.ajax({ type: 'post', url: '<?php echo $baseurl;?>/fetch_data.php', data: { get_option:val }, success: function (response) { document.getElementById("category").innerHTML=response; } }); } </script> </body> </html>