Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- THIS WHOLE SYSTEM WAS CREATED BY Haze aka Blubb1337.
- ALL RIGHTS RESERVED (C) 2011
- SHARING THIS ON OTHER SITES IS FORBIDDEN UNLESS I GIVE YOU THE PERMISSION TO DO IT.
- PLEASE ENJOY AND IF YOU FIND ANY BUGS OR YOU HAVE IDEAS THAT CAN BE ADDED INTO THIS SYSTEM, please tell me.
- */
- ?>
- <?php
- include("conn.php");
- /* Table structure
- id
- username
- password
- email
- ip
- hwid
- activationlink
- activated
- banned
- */
- /*page should look like this
- register.php?username=&password=&email=&hwid=*/
- function genRandomString() {
- $length = 20;
- $characters = "0123456789abcdefghijklmnopqrstuvwxyz";
- for ($p = 0; $p < $length; $p++) {
- $string .= $characters[mt_rand(0, strlen($characters))];
- }
- return $string;
- }
- $username = $_GET['username'];
- $password = $_GET['password'];
- $pw = md5($password);
- $email = $_GET['email'];
- $ip = $_SERVER['REMOTE_ADDR'];
- $hwid = $_GET['hwid'];
- $alink = genRandomString();
- //account limit per PC
- $acclimit = 5;
- //see if all variables are filled
- if(isset($username)) {
- if(isset($pw)) {
- if(isset($email)) {
- if(isset($hwid)) {
- if(isset($alink)) {
- //see if the user already exists
- $querySearch = "SELECT * FROM users WHERE Username='".$username."' OR Email='".$email."'";
- $result = mysql_query($querySearch);
- $count = mysql_num_rows($result);
- if($count == 0) {
- $queryLimit = "SELECT * FROM users WHERE HWID='".$hwid."'";
- $result = mysql_query($queryLimit);
- $count = mysql_num_rows($result);
- if($count < $acclimit or $count == $acclimit) {
- $query = "INSERT INTO users(Username,Password,Email,IP,HWID,ActivationLink,Activated,Banned)
- VALUES
- ('".$username."','".$pw."','".$email."','".$ip."','".$hwid."','".$alink."','0','0')";
- echo $query."<br />";
- mysql_query($query) or die(mysql_error());
- } else {
- echo "You have reached the limit of maximum accounts per PC."; }
- } else {
- echo "There is already an account with the same username or email"; }
- }}}}}
- ?>
Add Comment
Please, Sign In to add comment