Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.28 KB | None | 0 0
  1. <div id="content">
  2. <div class="cui ctop"></div>
  3.  
  4. <!-- Main Content Container -->
  5.  
  6. <div class="cui ccon">
  7. <div class="clearfix"></div>
  8.  
  9.  
  10. <?php include 'news.php' ?>
  11.  
  12. <!-- Sample Content -->
  13. <div class="cbox-ui cbox-title"><h2>Metin2 United - Register</h2></div>
  14. <div class="cbox-ui cbox-content">
  15. <div class="clearfix"></div>
  16. <!--<p><center>Registration is undergoing maintenance for your security.<br />Please be somewhat patient and stop flaming us via email. Thanks</center></p>-->
  17. <?php
  18. include('securitymt2/config.php');
  19. $badcode = false;
  20. $badmail = false;
  21. $baduser = false;
  22. $registration_success = false;
  23. if(isset($_POST['submit']) && $_POST['submit'] == 'register') {
  24. if (isset($_POST['username']) && strlen($_POST['username']) <= 3) {
  25. $baduser = true;
  26. }
  27. $username = mysql_real_escape_string($_POST['username']);
  28. $username = mysql_real_escape_string($_POST['username']);
  29. $password = mysql_real_escape_string($_POST['password']);
  30. if (preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)$/i', $_POST['email'])) {
  31. $email = mysql_real_escape_string($_POST['email']);
  32. }
  33. else {
  34. //echo '<p style="text-align:center; color:red">Your E-mail adress doesn\'t look like a working one...</p>';
  35. $badmail = true;
  36. }
  37. if (preg_match('/^[0-9]{7}$/', $_POST['code'])) {
  38. $code = $_POST['code'];
  39. }
  40. else {
  41. //echo '<p style="text-align:center; color:red">The code must have 7 digits...</p>';
  42. $badcode = true;
  43. }
  44. //echo '<!--';
  45. //print_r($_REQUEST);
  46. //echo '-->';
  47. if (isset($username) && isset($password) && isset($email) && isset($code) && !($baduser || $badmail || $badcode)) {
  48. $sql = "INSERT INTO account SET login = '$username', password = PASSWORD('$password'), email = '$email', social_id = '$code'";
  49. $result = mysql_query($sql);
  50. if($result) {
  51. echo '<center><b><font color="green">You have successfully created an account.</font></b></center>';
  52. $registration_success = true;
  53. }
  54. else {
  55. echo '<center><b><font color="red">We are sorry, that account already exists.</font></b></center>';
  56. $registration_success = false;
  57. }
  58. }
  59. else {
  60. echo '<center><b><font color="red">Something went wrong, please check everything again.</font></b></center>';
  61. $registration_success = false;
  62. }
  63. }
  64. if (!$registration_success):
  65. ?>
  66. <script type="text/javascript" src="/js/passwordmeter.js"></script>
  67. <form action="/index.php?section=register" method="post" name="registration">
  68. <center>
  69. <table border="0" cellpadding="0" cellspacing="3" width="650">
  70. <tbody><tr>
  71. <td width="159">&nbsp;</td>
  72. <td width="172">&nbsp;</td>
  73. <td width="324">&nbsp;</td>
  74. </tr>
  75. <tr>
  76. <td><b>Account ID</td>
  77. <td><label>
  78. <input type="text" name="username" maxlength="12" value="<?php echo (isset($_POST['username']))?$_POST['username']:''; ?>">
  79. </label></td>
  80. <td><b><?php if ($baduser) echo '<span style="color:red">' ?>at least 3 and max. 12 characters<?php if ($baduser) echo '</span>' ?></b></td>
  81. </tr>
  82. <tr>
  83. <td><b>Password</td>
  84. <td><label>
  85. <input type="password" name="password" maxlength="14" value="<?php echo (isset($_POST['password']))?$_POST['password']:''; ?>" onkeyup="testPassword(document.forms.registration.password.value)">
  86. </label></td>
  87. <td><b>max. 14 characters</b>, strength: <span id="pwstrength">weak</span></td>
  88. </tr>
  89. <tr>
  90. <td><label for="email"><b>E-Mail Address</b></label></td>
  91. <td><input type="text" name="email" value="<?php echo (isset($_POST['email']))?$_POST['email']:''; ?>"></td>
  92. <td><?php
  93. if ($badmail) echo '<span style="color:red">please type in a valid one...</span>';
  94. else echo '&nbsp;';
  95. ?></td>
  96. </tr>
  97. <tr>
  98. <td><label for="code"><b>Character-Delete Code</b></label></td>
  99. <td><input type="text" name="code" maxlength="7" value="<?php echo (isset($_POST['code']))?$_POST['code']:''; ?>"></td>
  100. <td><b>7 digits</b> (your secret code to delete your ingame-character<?php if ($badcode) echo ', <span style="color:red">this should be really a number of seven digits...</span>'; ?>)</td>
  101. </tr>
  102. <tr>
  103. <td><input type="submit" name="submit" value="register" /></td>
  104. <td><!--<input type="reset" name="reset" value="reset" />--></td>
  105. <td>&nbsp;</td>
  106. </tr>
  107. </tbody></table></center></form></td>
  108. </tr>
  109. </tbody></table></center></td>
  110. </tr>
  111. <tr>
  112. <td>&nbsp;</td>
  113. </tr>
  114. </tbody></table>
  115. </p>
  116. <?php
  117. endif; // $registration_success
  118. ?>
  119.  
  120.  
  121. <div class="clearfix"></div>
  122. </div>
  123. <div class="cbox-ui cbox-end"></div>
  124. <div class="clearfix"></div>
  125. </div>
  126. <div class="cui cbottom"></div>
  127.  
  128. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement