Ajj is article me apko btaya jayega ki ham mobile Otp verification signup form kese bana sakte hai.apne mostly bdi bdi website jese google ,facebook etc me dekha hoga ki jab be ham signup karte hai to pehle hmare pass google or facebook ke traf se ek otp code hmare phone number me ata hai jab ham us otp ko signup form me enter karke verify karte hai tbhi hmara account banta hai. ajj me apko isi ke bare me btane wala hu jiski madad se aap ye feature apni website me integrate kar sakte ho.Mere is post ko read karne ke bad aap easily within 5 minute me Mobile OTP Verification Php script Bana Sakte ho.
Mobile Otp Verication Kiu Jarruri Hai-apko me iska sidha or simple answer btata hu mobile verification ke help se users (hackers)kisi dusre user ke mobile number ko kisi be account,spam account banana ke liye use nhi kar sakte hai……otp ki wajah se hmara number tbhi registered hota hai agar ham otp code dal kar signup form verify karte hai……
Steps for simple Mobile Otp Verification –
index2.php
<center><form action="mail.php" method="post">
firstname:<input type="text" name="first_name">
lastname:<input type="text" name="last_name">
phone<input type="text" name="phone">
<input type="submit" name="submit" value="submit">
</form>
Yanha sabse pehle ek index2.php name ki ek file create ki hai jiski madad se user apna name,phone number enter karke submit karega.
mail.php
<center>
<?php
session_start();
$code=rand(22222,99999);
$_SESSION["code"]=$code;
$phone=$_POST['phone'];
$_SESSION["phone"]=$phone;
$authKey = "enter Your auth key here";//enter your authkey here
$mobileNumber = $_POST["phone"];
$senderId = "ABCDEF";
$message = urlencode("otp number.".$code);
$route = "route=4";
$postData = array(
'authkey' => $authKey,
'mobiles' => $mobileNumber,
'message' => $message,
'sender' => $senderId,
'route' => $route
);
$url="https://control.msg91.com/api/sendhttp.php";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
if(curl_errno($ch))
{
echo 'error:' . curl_error($ch);
}
curl_close($ch);
?>
<form action="mail2.php" method="post">
<input name="captcha" type="text">
<input type="submit" name="submit" value="submit">
</form>
mail.php file me apko ab authkey enter karne hai.
Authkey hame kisi be mobile sms service provider company dwara provide ki jati hai …means iske liye hame kisi be mobile sms provider company se smskhridne padte hai jiske bad ham iska use kar sakte hai ,ese bhut se website hai jo hame sms provide karte hai ajj me apko msg91.com
Company ke bare me btaunga jo ki ek achi sms serice provider company hai.
Authkey ke liye aap niche diye gye steps follow kare-
1-sabse pehle aap http://msg91.com/
Website open kijiye
2-ab yanha signup kar lijiye
3- ab msg91 company apke mobile number par apka username and password bhejegi aap uska use karke login kar lijiye.
4-ab apko dashboard me api option par click karna hai.
5-yanha apko ap authkeyi key milegi.yanha se aap api authkey lene ke bad mail.php file me paste kar de or code ko save kar de.
Note -Agar apko api key ,authkey ke related koi be problem a rhe hai to msg91.com website me footer section me apko live chat ka option milega wanha se app technical support team se help le sakte ho..app ek bar login hone ke bad logout kare or firse dobara login kare tab apka account live ho jayega or bilkul sahi trike se work karne lag jayega.
mail2.php
<center>
<br>
<br>
<br>
<br>
<br>
<?php
session_start();
$code="";
if(isset($_POST["captcha"])&&$_POST["captcha"]!=""&&$_SESSION["code"]==$_POST["captcha"])
{
echo $captcha=$_POST['captcha'];
echo "<br>";
echo "Correct Code Entered";
session_destroy();
//Do you stuff
}
else
{
echo "Wrong Code Entered Try Again";
?>
<form action="mail2.php" method="post">
<input name="captcha" type="text">
<input type="submit" name="submit" value="submit">
</form>
<?php } ?>
<a href="index2.php">Index</a>
</center>
Mail2.php check karegi ki apke dwara enter kiya gya otp code and user ke mobile pe bheja gya otp code same hai ya nhi
Aap agar chaho to user ki information database me be store karwa sakte ho iske liye apko if statement me captcha code correct ke bilkul sath niche apne query likhne hai .
Is parkar aap easily mobile otp verification registration form bana sakte ho wo be sirf 5 to 10 minutes me.
Aap check kar sakte ho jo ki mene email otp veriication script wali post ki hai and ye mobile otp verication 80 % same coding hai ,email otp me phpmailer ka use kiya gya tha mail bhejne ke liye,or yanha ham message msg91.com company me curl ka use karke send kar rahe hai.me hmesha same to same coding karne ki koshish karta hu takki aap logo ko asani se samjh a jaye or ap confuse na ho …….
Aap niche diye gye link se complete code download kar sakte hai.
Me ummid karta hu ki apko mere ye post achi lagi hogi agar apko koi problem a rhe hai to aap comment me puch sakte ho me apki purri help karunga.
Thank You
Team Gajabwap Web In HIndi…
Also Read-
ConversionConversion EmoticonEmoticon