Advertisement
Guest User

Untitled

a guest
Mar 10th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <?php
  2. include "config.php";
  3. $mobile = $_POST['mobile'];
  4. $p_id=$_POST['id'];
  5. $cmpny=$_POST['cmpny'];
  6. $name=$_POST['name'];
  7. $cmob=$_POST['cmob'];
  8. $cat=$_POST['cat'];
  9. date_default_timezone_set('Asia/Kolkata');
  10. $date=date('Y-m-d H:i:s');
  11. $password = rand(0000,9999);
  12. $username = 'support@otomarket.in';
  13. $hash = '2bfc32d420f59873929523bf5488b602c96057e6';
  14.  
  15. // Message details
  16. $numbers = "$mobile";
  17. $sender = urlencode('OTOMKT');
  18. $message = rawurlencode("Hello,
  19. Your OTP is - ".$password."
  20. Thank you for your enquery.
  21. OTOMarket.in");
  22.  
  23. $numbers = $numbers;
  24.  
  25. // Prepare data for POST request
  26. $data = array('username' => $username, 'hash' => $hash, 'numbers' => $numbers, "sender" => $sender, "message" => $message);
  27.  
  28. // Send the POST request with cURL
  29. $ch = curl_init('http://api.textlocal.in/send/');
  30. curl_setopt($ch, CURLOPT_POST, true);
  31. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  32. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  33. $response = curl_exec($ch);
  34. curl_close($ch);
  35.  
  36. // Process your response here
  37. //echo $response;
  38. $l=1;
  39. $sql="insert save_mobile(p_id,mobile,date,request_limit,otp) values('$p_id','$mobile','$date','$l','$password')";
  40. $result=$mysqli->query($sql);
  41. header("location:details.php?id=$p_id&r=$numbers&p_id=$p_id");
  42. //}
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement