Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['name'])
- && isset($_POST['password'])
- && isset($_POST['password_two']))
- {
- $name = $_POST['name'];
- $name = stripslashes($name);
- $name = trim($name);
- $name = htmlspecialchars($name);
- $password = $_POST['password'];
- $password = stripslashes($password);
- $password = trim($password);
- $password = htmlspecialchars($password);
- $password_two = $_POST['password_two'];
- $password_two = stripslashes($password_two);
- $password_two = trim($password_two);
- $password_two = htmlspecialchars($password_two);
- if ($password != $password_two) {
- echo 'Error: Password mismatch!';
- echo "<script>setTimeout('location=document.location.href', 3000 )</script>";
- die();
- }
- include 'a_api.php';
- $result = $proxy->createAccountEx($name, $password, AccessLevel::User(), AccountStatus::Active(), $name, null);
- if ($result->isOk()) {
- echo " Account successfully created!";
- echo "<script>setTimeout('location=document.location.href', 3000 )</script>";
- } else {
- echo " Error: The account already exists!";
- echo "<script>setTimeout('location=document.location.href', 3000 )</script>";
- return false;
- }
- } else {
- ?>
- <form method="post" style="max-width:500px;margin:auto">
- <h2>Register Form</h2>
- <div class="input-container">
- <i class="fa fa-user icon"></i>
- <input placeholder="Username" class="input-field" type="text" name="name" pattern="[A-Za-z0-9]{4,16}" required />
- </div>
- <div class="input-container">
- <i class="fa fa-key icon"></i>
- <input placeholder="Password" class="input-field" type="password" name="password" pattern="[A-Za-z0-9]{4,16}" required />
- </div>
- <div class="input-container">
- <i class="fa fa-key icon"></i>
- <input placeholder="Confirm Password" class="input-field" type="password" name="password_two" pattern="[A-Za-z0-9]{4,16}" required />
- </div>
- <div class="input-container">
- <button type="submit" class="btn" value="Registration">Register</button>
- </div>
- <p><a href="?change">Change Password Form!</a></p>
- </form>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement