Guest User

Untitled

a guest
Aug 10th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1. <?php require("theme.php"); ?>
  2. <html>
  3. <title> Loading.. </title>
  4. <body>
  5. <center>
  6. <font face='Courier'>
  7. <?php
  8. $username=$_POST['username'];
  9. $password_not_encrypted=$_POST['password'];
  10. $cPassword=$_POST['ConfirmPassword'];
  11. $email=$_POST['email'];
  12. $ch1 = $_POST['ch1'];
  13. // $at=preg_match($email, '/.\@./');
  14.  
  15.     // -------------@@@@ encryption part @@@@@@----------------
  16.     $encrypt_num_one = md5($password_not_encrypted, FALSE);
  17.     $base=base64_encode($encrypt_num_one);
  18.     $password=substr($base,0,43);
  19.     // ----------------------@@@@@@@@@@@@@@@@@@@----------------
  20.  
  21.     if($ch1==false)
  22.     {
  23.         echo "<div id='LoginColor'> Accept the trems first!</div>";
  24.     }
  25.     elseif($username==NULL || $password_not_encrypted==NULL || $cPassword==NULL || $email==NULL)
  26.     {
  27.         echo "<div id='LoginColor'> <br/>Please fill all the fields.</div>";
  28.        
  29.     }
  30.     elseif($password_not_encrypted!=$cPassword)
  31.     {
  32.         echo "<div id='LoginColor'> <br/>The passwords are not the same. </div>";
  33.     }
  34.     /* elseif($at=='@') {
  35.         echo "<div id='LoginColor'> <br />Please enter vaild Email. </div>";
  36.     } */
  37.    
  38.     //---------------------Check if the username already in use ----------
  39.     $link=mysql_connect('localhost', 'zer0gravUser', 'zer0gravUserPass');
  40.     mysql_select_db('zer0gravity');
  41.     $check=mysql_query("SELECT * FROM users WHERE username='$username';");
  42.     if(mysql_num_rows($check) == 1)
  43.     {
  44.         echo "<br/><div id='LoginColor'> this Username('$username') already taken.</div>";
  45.     }
  46.     $EmailCheckQuery="SELECT email from users WHERE email='$email'";
  47.     $Final=mysql_num_rows($EmailCheckQuery);
  48.     if(mysql_num_rows($EmailCheckQuery)==1) {
  49.         echo "<br/><div id='LoginColor'> This email($email) already in use.</div>";
  50.     }
  51.     mysql_close($link);
  52.     // --------------------------------------------------------------------
  53.    
  54.     // ------------------ MYSQL SERVER CREATES ACCOUNT -------------------
  55.     if(($username!=NULL || $password_not_encrypted!=NULL || $cPassword!=NULL || $email!=NULL) && ($ch1==true) && ($password_not_encrypted==$cPassword) && (mysql_num_rows($check) != 1) && $Final != 1)
  56.     {
  57.     try {
  58.     $connection=mysql_connect('localhost', 'zer0gravUser', 'zer0gravUserPass');
  59.     mysql_select_db('zer0gravity', $connection);
  60.     $Create_Account = "INSERT INTO users (username, password, email) VALUES('$username', '$password', '$email')";
  61.     $Query = mysql_query($Create_Account, $connection);
  62.     mysql_close($connection);
  63.     }
  64.     catch(Exception $e) {
  65.     die("<p /> Cannot connect to the MySQL server: " . mysql_error());
  66.     echo $e;
  67.     }
  68.     echo "<br />Registered Susscessfuly!<br/>An email sent to you with all your details.";
  69.     echo "<br/>-----<br/>";
  70.     //echo "<br /><a href='Register.php'>[Back]</a>
  71.     //<a href='index.php'>[index]</a>";
  72.     }
  73.     /* mail($email, 'Zer0Gravity details - [Register]', "Hello! Your details :
  74.     Username: $username
  75.     Pasword: $password
  76.     email: $email");
  77.     */
  78.     // ------------------------------------------------------------------------
  79.        
  80.     echo "<br /><a href='Register.php'>[Back]</a>
  81.     <a href='index.php'>[index]</a>";
  82. ?>
  83. </font>
  84. </center>
  85. </body>
  86. </html>
Add Comment
Please, Sign In to add comment