session_start(); require_once("connect.php"); include("quiz/admin/connection.php"); if(isset($_REQUEST['action'])) { if($_REQUEST['action']=="register") { echo $key=substr($_SESSION['key'],0,5); echo $number = $_REQUEST['number']; if($number==$key) { $otp=rand (1000 , 9999); $uname=rand (100 , 999); $name = $_REQUEST['name']; $email = $_REQUEST['email']; $address =$_REQUEST['address']; $mobile = $_REQUEST['phone']; $enq = $_REQUEST['purpose']; $q1 = "insert into contact set uname='$uname', name='$name', email='$email', address='$address', mobile='$mobile', enq='$enq', otp='$otp'"; mysql_query($q1); if(mysql_error()) { $errs="alert-danger"; $emsg='Sql Error'; } else { $url = 'http://api.msg91.com/api/sendotp.php?authkey=256568AVsPt8bG5c3c2277&mobile='.$mobile.'&message=Your Verification Code '.$otp.'&sender=IQKIDS&otp='.$otp; file_get_contents($url); echo ""; } } else { $errs="alert-danger"; $err='Invalid Key'; } } } ?>