Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!empty($_POST['register-submit']))
- {
- //insert in table;sms on phn-otp;mail on id,pass confirm pass same
- echo "Thank you!<br>";
- $fname=$_POST["fname"];
- $lname=$_POST["lname"];
- $email=$_POST["email"];
- $user=$_POST["user"];
- $pass=$_POST["pass"];
- $cpass=$_POST["cpass"];
- $phn=$_POST["phn"];
- if($pass!=$cpass)
- {
- echo("Password nottt same.");
- }
- }
- //sms OTP
- //echo $name."<br>".$branch."<br>".$sex."<br>".$course."<br>".$contact."<br>".$emailid."<br>";
- $servername="localhost";
- $username="root";
- //create connection
- $conn=new mysqli($servername,$username,"","projectdb");
- //check connection
- if($conn->connect_error)
- {
- die("failed".$conn->connect_error);
- }
- //create database
- $sql="INSERT INTO users VALUES('".$fname."','".$lname."','".$email."','".$user."','".$pass."','".$phn."')"; //)",'".$_POST["column"]."')";
- if($conn->query($sql)===TRUE)
- {
- echo "You are successfully registered.<br><br>!";
- }
- else
- {
- echo "Some failure occured.";
- }
- $conn->close();
- //*****SMS AS A SERVICE********* http://control.msg91.com/user/index.php#api
- //Your authentication key
- $authKey = "118972AixJH0o8L57828cea";
- //Multiple mobiles numbers separated by comma
- $mobileNumber = $phn;
- //Sender ID,While using route4 sender id should be 6 characters long.
- $senderId = "102234";
- //Your message to send, Add URL encoding here.
- $message = urlencode("Hello".$fname.",<br>Thank You For Registering at VideoSharing site by AWS");
- //Define route
- $route = "default";
- //Prepare you post parameters
- $postData = array(
- 'authkey' => $authKey,
- 'mobiles' => $mobileNumber,
- 'message' => $message,
- 'sender' => $senderId,
- 'route' => $route
- );
- //API URL
- $url="https://control.msg91.com/api/sendhttp.php";
- // init the resource
- $ch = curl_init();
- curl_setopt_array($ch, array(
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $postData
- //,CURLOPT_FOLLOWLOCATION => true
- ));
- //Ignore SSL certificate verification
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- //get response
- $output = curl_exec($ch);
- //Print error if any
- if(curl_errno($ch))
- {
- echo 'error:' . curl_error($ch);
- }
- curl_close($ch);
- echo $output;
- }
Add Comment
Please, Sign In to add comment