Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * File : process.php
- * Location : alpha.alexmckechnie.com/includes/process.php
- * File Version : 0.0.1ALPHA
- * Author : Alex J. Mckechnie
- *
- * PLEASE NOTE ANY OUTPUT FROM THIS PAGE IS FOR DEBUGGING PURPOSES
- * AND WILL BE REMOVED IN THE FINAL VERSION
- *
- */
- //This stops SQL Injection in POST vars
- foreach ($_POST as $key => $value) {
- $_POST[$key] = mysql_real_escape_string($value);
- }
- //This stops SQL Injection in GET vars
- foreach ($_GET as $key => $value) {
- $_GET[$key] = mysql_real_escape_string($value);
- }
- #Decalre Some Global Variables
- $key = 'removed_for_security_concerns';
- $username = $_POST["username"];
- $password = $_POST["password"];
- $passconf = $_POST["passconf"];
- $email = $_POST["email"];
- $allowemail = $_POST["allowemail"];
- $time = time();
- $ipaddress = $_SERVER['REMOTE_ADDR'];
- function register()
- {
- /*
- * Validates Data, Encrpts Password, Inserts into database, Sets session info.
- */
- IF(!$username){$error['username'] = "The Username field was left empty.";}
- IF(!$password){$error['password'] = "The Password field was left empty.";}
- IF(!$passconf){$error['passconf'] = "The Confirm Password field was left empty.";}
- IF(!$email){$error['email'] = "You must provide an email address to register.";}
- IF(($password)!=($passconf))
- {
- IF($error['password'])
- {$error['password'] .= "<br />Your password's did not match. Please try again.";}
- ELSE
- {$error['password'] = "Your password's did not match. Please try again.";}
- }
- If($error)
- {
- die;
- } else {
- $password = sha1($password . $key);
- $query = "INSERT INTO `users` (`userID`, `username`, `password`, `jointime`, `lastonline`, `emailaddress`, `allowemail`, `usergroup`, `ipaddress`, `pastips`, `banned`, `banreason`, `admincomments`) VALUES (NULL, '$username', '$password', '$time', '$time', '$email', '$allowemail', 'member', '$ipaddress', '$ipaddress', '0', NULL, NULL)";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement