fork download
  1.  
  2. <?php
  3. include("include/connection.php");
  4.  
  5. if(isset($_POST['type']))
  6. {
  7. if($_POST['type']=='mobile'){
  8. @$mobile=$_POST['mobile'];
  9. $otp = "1234"; // fixed OTP
  10. $chkuser=mysqli_query($con,"select * from `tbl_user` where `mobile`='".$mobile."'");
  11. $userRow=mysqli_num_rows($chkuser);
  12. if($userRow==''){
  13.  
  14. unset($_SESSION["signup_mobile"]);
  15. unset($_SESSION["signup_otp"]);
  16. $_SESSION["signup_mobile"] = $mobile;
  17. $_SESSION["signup_otp"] = $otp;
  18.  
  19. $fields = array(
  20. "sender_id" => "FSTSMS",
  21. "message" => "Your verification code is $otp", // sending fixed OTP
  22. "language" => "english",
  23. "route" => "p",
  24. "numbers" => $mobile,
  25. "flash" => "1"
  26. );
  27.  
  28. $curl = curl_init();
  29.  
  30. CURLOPT_URL => "https://w...content-available-to-author-only...s.com/dev/bulk",
  31. CURLOPT_RETURNTRANSFER => true,
  32. CURLOPT_ENCODING => "",
  33. CURLOPT_MAXREDIRS => 10,
  34. CURLOPT_TIMEOUT => 30,
  35. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  36. CURLOPT_CUSTOMREQUEST => "POST",
  37. CURLOPT_POSTFIELDS => json_encode($fields),
  38. CURLOPT_HTTPHEADER => array(
  39. "authorization: BhVCnfShGnhn5wdL20mcTnyfjHEmzJGPJuPhmjbRO2HNmfJhJMR3t2E0MJBH",
  40. "accept: */*",
  41. "cache-control: no-cache",
  42. "content-type: application/json"
  43. ),
  44. ));
  45.  
  46. $response = curl_exec($curl);
  47. $err = curl_error($curl);
  48.  
  49. curl_close($curl);
  50.  
  51. if ($err) {
  52. echo "cURL Error #:" . $err;
  53. } else {
  54. echo '1';
  55. }
  56.  
  57. }else{echo"2";}
  58. }
  59.  
  60. if($_POST['type']=='otpval'){
  61. @$otp=$_POST['otp'];
  62. $mobile= $_SESSION["signup_mobile"];
  63. $sessionotp="1234"; // fixed OTP
  64. if(strlen($sessionotp!==$otp))
  65. {
  66. echo"0";
  67. }else{
  68. $_SESSION["signup_mobilematched"] =
  69. $_SESSION["signup_mobile"];
  70. unset($_SESSION["signup_mobile"]);
  71. unset($_SESSION["signup_otp"]);
  72. echo"1";
  73. }
  74. }
  75. }
  76. ?>
  77.  
  78.  
Success #stdin #stdout #stderr 0.02s 26192KB
stdin
Standard input is empty
stdout

stderr
PHP Warning:  include(include/connection.php): failed to open stream: No such file or directory in /home/b4jQhd/prog.php on line 3
PHP Warning:  include(): Failed opening 'include/connection.php' for inclusion (include_path='.:/usr/share/php') in /home/b4jQhd/prog.php on line 3