Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Coded by `P R O D I G Y™
- * @copyright 2011 - InterBB
- * This source is released as free, under the GNU-GPL License.
- */
- require("header.php");
- require("include/functions.php");
- $username = clean($_POST['username']);
- $password = hash('sha512', md5($_POST['password2']).$salt);
- $salt = salt(rand(5, 9));
- $password_repeat = hash('sha512', md5($_POST['password2']).$salt);
- $email = strtolower(clean($_POST['email']));
- $registration_IP = $_SERVER['REMOTE_ADDR'];
- $registration_Date = date("m-d-Y, H:i", time());
- if (isset($_POST['username']) && (count($_POST['username']) > 3) && isset($_POST['password']) && isset($_POST['password2']) && isset($_POST['email']) && isset($_POST['Agree'])) {
- $insert_query = 'insert into users (username, password, salt, email, registration_IP, registration_Date)
- values(
- "'.$username.'",
- "'.$password.'",
- "'.$salt.'",
- "'.$email.'",
- "'.$registration_IP.'",
- "'.$registration_Date.'"
- )';
- if($password != $password_repeat) {
- displayError("Passwords don't match");
- }
- if(!isset($username)) {
- displayError("You must supply a username.");
- }
- if(!isset($password)) {
- displayError("You must supply a password.");
- }
- if(!isset($email)) {
- displayError("You must supply an email.");
- }
- displaySuccess("Your account was successfully created, welcome to our forums.");
- mysql_query($insert_query) or die("<b>InterBB Error</b> : " . mysql_error());
- }
- if(!isset($_POST['Agree'])) {
- displayError("You must agree to our <a href=\"#\">Terms of Service</a> to be a member of this community.");
- }
- ?>
- <form name="input" action="register.php" method="post">
- Username: <input type="text" name="username" /><br />
- Email: <input type="text" name="email" /><br />
- Password: <input type="password" name="password" /><br />
- Password Again: <input type="password" name="password2" /><br /><br />
- <input type="checkbox" name="Agree" value="Agree">I agree to the <a href="#">Terms of Service</a>.<br /><br />
- <input type="submit" value="Register Account" />
- </form>
- <?php
- require("footer.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement