芝麻web文件管理V1.00
编辑当前文件:/home/krishnamexports/public_html/ajax/RegisterCustomer - Copy.php
0) { $arr = array('status'=>1, 'ErrorMsg'=>'
This Mobile no. Already Registered. Please Login First.
'); echo json_encode($arr); } else { $otp = generatePIN(); $sqlReg = mysqli_query($cn, "select mobile from `tbl_register` where `mobile`='".$mobile."'"); if(mysqli_num_rows($sqlReg)==0) { $sqlInsrt = mysqli_query($cn,"insert into `tbl_register` SET `name`='".$name."', `mobile`='".$mobile."', `email`='".$email."', `otp`='".$otp."', `status`=0, `date`=Now()"); if($sqlInsrt) { $arr = array('status'=>2, 'otp'=>$otp); echo json_encode($arr); } else { $arr = array('status'=>3, 'ErrorMsg'=>"Error Occured. Please Try again."); echo json_encode($arr); } } else { if(isset($_POST['otp']) && !empty($_POST['otp'])) { $otp = $_POST['otp']; $sqlReg = mysqli_query($cn, "select id,otp from `tbl_register` where `mobile`='".$mobile."'"); if(mysqli_num_rows($sqlReg) > 0) { $sqlRegData = mysqli_fetch_array($sqlReg); if($otp==$sqlRegData['otp']) { $_SESSION['KXloginId']=$sqlRegData['id']; $sqlInsrt = mysqli_query($cn,"update `tbl_register` SET `name`='".$name."', `mobile`='".$mobile."', `email`='".$email."', `status`=1 where `mobile`='".$mobile."'"); $arr = array('status'=>4, 'SuccessMsg'=>'
Success!
Successfully Login.
'); echo json_encode($arr); } else { $arr = array('status'=>5, 'ErrorMsg'=>'
Enter Correct OTP.
'); echo json_encode($arr); } } } else { $sqlInsrt = mysqli_query($cn,"update `tbl_register` SET `name`='".$name."', `mobile`='".$mobile."', `email`='".$email."', `otp`='".$otp."' where `mobile`='".$mobile."'"); $arr = array('status'=>2, 'otp'=>$otp); echo json_encode($arr); } } } ?>