Guest User

Untitled

a guest
Mar 18th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['g-recaptcha-response'])&& $_POST['g-recaptcha-response']){ var_dump($_POST);
  4. $secret = "secret code";
  5. $ip = $_SERVER['REMOTE_ADDR'];
  6. $captcha = $_POST['g-recaptcha-response'];
  7. $rsp = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=$captcha&remoteip$ip");
  8. $arr = json_decode($rsp,TRUE);
  9. if($arr['success']){
  10. $to = "mail";
  11. $subject = ' Massage';
  12. $message = "Best Regards";
  13. $header="welcome";
  14. $retval = mail ($to,$subject,$message,$header);
  15.  
  16. if( $retval == true )
  17. {
  18.  
  19. echo "<script>alert('Message sent successfully...')</script>" ;
  20.  
  21. echo "<script>window.open('../contact.php','_self')</script>" ;
  22. }
  23. else
  24. {
  25.  
  26. echo "<script>alert('Message could not be sent1...')</script>" ;
  27.  
  28. echo "<script>window.open('../contact.php','_self')</script>" ;
  29. } }else{ echo "<script>alert('Message could not be sent...')</script>" ;
  30.  
  31. echo "<script>window.open('../contact.php','_self')</script>" ; } }
  32.  
  33.  
  34.  
  35. ?>
Add Comment
Please, Sign In to add comment