Header AD

otp

 

How to Implement OTP SMS Mobile Verification in PHP with TextLocal
Mobile Number Verification
function sendOTP() { $(".error").html("").hide(); var number = $("#mobile").val(); if (number.length == 10 && number != null) { var input = { "mobile_number" : number, "action" : "send_otp" }; $.ajax({ url : 'controller.php', type : 'POST', data : input, success : function(response) { $(".container").html(response); } }); } else { $(".error").html('Please enter a valid number!') $(".error").show(); } } function verifyOTP() { $(".error").html("").hide(); $(".success").html("").hide(); var otp = $("#mobileOtp").val(); var input = { "otp" : otp, "action" : "verify_otp" }; if (otp.length == 6 && otp != null) { $.ajax({ url : 'controller.php', type : 'POST', dataType : "json", data : input, success : function(response) { $("." + response.type).html(response.message) $("." + response.type).show(); }, error : function() { alert("ss"); } }); } else { $(".error").html('You have entered wrong OTP.') $(".error").show(); } }

Post a Comment

Post a Comment (0)

Previous Post Next Post

ads

Post ADS 1

ads

Post ADS 1