Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. include 'dbconnect.php';
  4.  
  5. if(isset($_POST['username'])) {
  6. $key = '6LfjXCITAAAAALsTlmkF2yUBM4dzr7SSsD3wPhNf';
  7. $url = 'https://www.google.com/recaptcha/api/siteverify';
  8.  
  9. $response = file_get_contents($url . "?secret=" . $key . "&response=" . $_POST['g-recaptcha-response'] . "&remoteip=" . $_SERVER['REMOTE_ADDR']);
  10.  
  11. $data = json_decode($response);
  12.  
  13. if(isset($data->success) AND $data->success==true) {
  14.  
  15. $username = strip_tags($_POST['username']);
  16. $password = md5(strip_tags($_POST['pass']));
  17. $email = strip_tags($_POST['email']);
  18. $bd = $_POST['birthday'];
  19.  
  20. $sql = $dbCon->query("INSERT INTO members(username, password, email, birthday) Values('{$username}','{$password}','{$email}','{$bd}')");
  21. }
  22.  
  23. }
  24.  
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement