Skip to main content

User Registration Form WITH Mobile OTP-SMSHorizon API In PHP

How to send sms With horizon api

Hello friends ajj me apko btaunga ki Smshorizon api ka use karke user ke mobile par otp message kese send kare-



Steps for send otp with smshorizon api-

Index2.php


<center>


<fieldset>

<form action="mail.php" method="post">



<h1> Send Otp With SMSHORIZON</h1>

Message<input type="text" name="message">



<br><br>

Mobile<input type="text" name="mobile">

<br>

<input type="submit" name="submit" value="submit">

</form></fieldset>

</center>

<br>

<br>

<br>





Yanha index2.php file ke madad se ham ek form create karege jiski madad se user message and phone number enter karke submit karega.

mail.php

<center>

<?php

session_start();





// Replace with your username

$user = "bhupenderkashya2222p41511111";//enter your username here



// Replace with your API KEY (We have sent API KEY on activation email, also available on panel)

$apikey = "UDeOV333354gvkCGdsHffddss434543543545432yjDKMcstvs9"; //enter your api key here



// Replace if you have your own Sender ID, else donot change

$senderid  =  "MYTEXT";



// Replace with the destination mobile Number to which you want to send sms

$mobile  =  $_POST['mobile'] ;

$_SESSION["mobile"]=$mobile;

// Replace with your Message content

$message   =  rand(22222,99999);

$_SESSION["message"]=$message;

$message = urlencode($message);



// For Plain Text, use "txt" ; for Unicode symbols or regional Languages like hindi/tamil/kannada use "uni"

$type   =  "txt";



$ch = curl_init("http://smshorizon.co.in/api/sendsms.php?user=".$user."&apikey=".$apikey."&mobile=".$mobile."&senderid=".$senderid."&message=".$message."&type=".$type."");

    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    $output = curl_exec($ch);      

    curl_close($ch);



// Display MSGID of the successful sms push

echo $output;



?>

<form action="mail2.php" method="post">

<input name="captcha" type="text">

<input type="submit" name="submit" value="submit">

</form>



Yanha mail.php file me hame  username and  api key enter karne hai apne smshorizon  account ki.



SMS horizon api Kese generate kare----


Step1-sabse pehle  https://smshorizon.co.in/

mee enter kijiye

Step2- ab yanha signup kar lijiye

Step3-ab aap apne username and password se login ho jaiye

Step4-ab aap dashboard me redirect ho jaiyege

Step 5  yanha aap  http api par click kijiye


click on http api



Step6-ab manage API key par click kijiye



click on manage api key




Step7-yanha se apko apka username and api key mil jaiyegi.





smshorizon username and api key


Step8- ab aap api key and username ko  mail.php file me paste karke code ko save kar lijiye.









mail2.php





<center>

<br>

<br>

<br>

<br>

<br>

<?php

session_start();

$message="";

if(isset($_POST["captcha"])&&$_POST["captcha"]!=""&&$_SESSION["message"]==$_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 file check karegi ki apke dwara enter kiya gya otp code and script dawara  apke phone par bheja gya message same hai ya nahi agar same hoga tbhi user ka account verify hoga or apke pass message ayega ki correct code entered.


Is parkar aap easily smshorizon php api ka use karke  apne website ke liye mobile otp registeration form teyar kar sakte hai.

Agar apko koi be problem a rhe hai to aap comment me puch sakte ho

Or aap niche diye gye link se complete code download kar sakte ho apko sirf code me (mail.php) me username and api key dalane hai bas.





Download Full Code Of SMSHORIZON API in Php

Thank You

Team Gajabwap Web In Hindi


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 = "...