Skip to main content

How To Create User Registration With Mobile OTP In PHP -Full Guide In Hindi


 mobile verification code in php

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-

Comments

Popular posts from this blog

How to Download Vimeo Thumbnail With PHP

Vimeo Thumbnail Downloader Tool – Vimeo Video Ka Thumbnail Download Karein Aaj ke is tutorial mein hum Vimeo Thumbnail Downloader Tool ke baare mein jaanenge. Is tool ki help se hum Vimeo video URL se us video ki thumbnail image obtain kar sakte hain. Agar aap PHP, Web Development, HTML, CSS aur Online Tools banana seekh rahe hain, to ye ek useful PHP project example hai. Vimeo Thumbnail Downloader Kya Hai? Vimeo Thumbnail Downloader ek simple tool hai jisme user Vimeo video ka URL enter karta hai. Tool Vimeo video ID ko identify karta hai aur available thumbnail image ko display karta hai. Example Vimeo URL: https://vimeo.com/389063954 Is URL mein: 389063954 Vimeo video ID hai. Vimeo Thumbnail Downloader Kaise Work Karta Hai? Is PHP script mein mainly do functions use kiye gaye hain: 1. getVimeoId() Ye function Vimeo URL se video ID find karta hai. 2. getVimeoThumb() Ye function Vimeo video ID ke basis par thumbnail information retrieve karta hai aur available thumbnail...

How To Create Contact Form With Validation-Php & Html

How To Create Contact Form - Hello Friends Ajj Me Apko Btaunga   Ki Kis Prakar   Ham Apni Website Ke Liye Contact Form Bnana Sakta Hai.( By Using   Php Contact Form With Validation Script ) Contact Form Hmare Website Ke Liye Bhut He Jrruri Hota Hai.Contact Form Ke Help Se He User Apna Message Website Owner(Admin) Ko Bhej Sakte Hai. Ajj Me Apko Btane Wala Hu Ki Kis Parkar Ham Contact Form Banakar Apne Website Me Add Kar Sakte Hai Or Apni Website Ke Liye Contact Form Bana Sakte Hai Is Contact Form Me   Ham Php Mail Function() Ka Use Karege . Ab Jab Be Koi User Contact Form Me Apni Information ,Message Details Fill Karke Submit Karega To Uski Sare Information Website Admin Ke Email Id Par A Jaiyegi Jo Be Admin Dwara   Niche Diye Gye Code Me Setup Ki Hogi. Used Language- ·          HTML ·          Jquery ·          Php ...

How To Send Sms From Website Using Php-Textlocal SMS

Hello Friends Ajj Me Apko Btaunga Ki Kis Prakar Aap Apni Website Me Free Sms Send Ka Option Integrate Kar Sakte Ho. Bulk sms in India-Best company Iske Liye Apko Sabse Pehle   Https://Www.Textlocal.In/Signup Par Signup Karke Account Create Karna Hai.Ye Ek Achi bulk sms provider company hai ·          Account Create Hone Ke Bad Aap Apna Username And Password Enter Karke Apne Dashboard Me Login Ho Jaiye( textlocal login) ·          Yanha Apko Text Local Company Dwara 10 Meassge Free Testing Ke Liye Diye Jayege ·          Aap Sms Plan Buy Kar Sakte Ho Is Company Dwara Bhut He Kam Prize Me Sms Pakage,plan provide  Kiye Jate Hai Textlocal Price Plans –  index.php <?php if(isset($_POST['code']) &&  isset($_POST['mobile'])){ // Authorisation details. $username = "enter your textlocal account email id here"; $hash = "...