Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="content">
- <div class="cui ctop"></div>
- <!-- Main Content Container -->
- <div class="cui ccon">
- <div class="clearfix"></div>
- <?php include 'news.php' ?>
- <!-- Sample Content -->
- <div class="cbox-ui cbox-title"><h2>Metin2 United - Register</h2></div>
- <div class="cbox-ui cbox-content">
- <div class="clearfix"></div>
- <!--<p><center>Registration is undergoing maintenance for your security.<br />Please be somewhat patient and stop flaming us via email. Thanks</center></p>-->
- <?php
- include('securitymt2/config.php');
- $badcode = false;
- $badmail = false;
- $baduser = false;
- $registration_success = false;
- if(isset($_POST['submit']) && $_POST['submit'] == 'register') {
- if (isset($_POST['username']) && strlen($_POST['username']) <= 3) {
- $baduser = true;
- }
- $username = mysql_real_escape_string($_POST['username']);
- $username = mysql_real_escape_string($_POST['username']);
- $password = mysql_real_escape_string($_POST['password']);
- 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'])) {
- $email = mysql_real_escape_string($_POST['email']);
- }
- else {
- //echo '<p style="text-align:center; color:red">Your E-mail adress doesn\'t look like a working one...</p>';
- $badmail = true;
- }
- if (preg_match('/^[0-9]{7}$/', $_POST['code'])) {
- $code = $_POST['code'];
- }
- else {
- //echo '<p style="text-align:center; color:red">The code must have 7 digits...</p>';
- $badcode = true;
- }
- //echo '<!--';
- //print_r($_REQUEST);
- //echo '-->';
- if (isset($username) && isset($password) && isset($email) && isset($code) && !($baduser || $badmail || $badcode)) {
- $sql = "INSERT INTO account SET login = '$username', password = PASSWORD('$password'), email = '$email', social_id = '$code'";
- $result = mysql_query($sql);
- if($result) {
- echo '<center><b><font color="green">You have successfully created an account.</font></b></center>';
- $registration_success = true;
- }
- else {
- echo '<center><b><font color="red">We are sorry, that account already exists.</font></b></center>';
- $registration_success = false;
- }
- }
- else {
- echo '<center><b><font color="red">Something went wrong, please check everything again.</font></b></center>';
- $registration_success = false;
- }
- }
- if (!$registration_success):
- ?>
- <script type="text/javascript" src="/js/passwordmeter.js"></script>
- <form action="/index.php?section=register" method="post" name="registration">
- <center>
- <table border="0" cellpadding="0" cellspacing="3" width="650">
- <tbody><tr>
- <td width="159"> </td>
- <td width="172"> </td>
- <td width="324"> </td>
- </tr>
- <tr>
- <td><b>Account ID</td>
- <td><label>
- <input type="text" name="username" maxlength="12" value="<?php echo (isset($_POST['username']))?$_POST['username']:''; ?>">
- </label></td>
- <td><b><?php if ($baduser) echo '<span style="color:red">' ?>at least 3 and max. 12 characters<?php if ($baduser) echo '</span>' ?></b></td>
- </tr>
- <tr>
- <td><b>Password</td>
- <td><label>
- <input type="password" name="password" maxlength="14" value="<?php echo (isset($_POST['password']))?$_POST['password']:''; ?>" onkeyup="testPassword(document.forms.registration.password.value)">
- </label></td>
- <td><b>max. 14 characters</b>, strength: <span id="pwstrength">weak</span></td>
- </tr>
- <tr>
- <td><label for="email"><b>E-Mail Address</b></label></td>
- <td><input type="text" name="email" value="<?php echo (isset($_POST['email']))?$_POST['email']:''; ?>"></td>
- <td><?php
- if ($badmail) echo '<span style="color:red">please type in a valid one...</span>';
- else echo ' ';
- ?></td>
- </tr>
- <tr>
- <td><label for="code"><b>Character-Delete Code</b></label></td>
- <td><input type="text" name="code" maxlength="7" value="<?php echo (isset($_POST['code']))?$_POST['code']:''; ?>"></td>
- <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>
- </tr>
- <tr>
- <td><input type="submit" name="submit" value="register" /></td>
- <td><!--<input type="reset" name="reset" value="reset" />--></td>
- <td> </td>
- </tr>
- </tbody></table></center></form></td>
- </tr>
- </tbody></table></center></td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </tbody></table>
- </p>
- <?php
- endif; // $registration_success
- ?>
- <div class="clearfix"></div>
- </div>
- <div class="cbox-ui cbox-end"></div>
- <div class="clearfix"></div>
- </div>
- <div class="cui cbottom"></div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement