Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require("theme.php"); ?>
- <html>
- <title> Loading.. </title>
- <body>
- <center>
- <font face='Courier'>
- <?php
- $username=$_POST['username'];
- $password_not_encrypted=$_POST['password'];
- $cPassword=$_POST['ConfirmPassword'];
- $email=$_POST['email'];
- $ch1 = $_POST['ch1'];
- // $at=preg_match($email, '/.\@./');
- // -------------@@@@ encryption part @@@@@@----------------
- $encrypt_num_one = md5($password_not_encrypted, FALSE);
- $base=base64_encode($encrypt_num_one);
- $password=substr($base,0,43);
- // ----------------------@@@@@@@@@@@@@@@@@@@----------------
- if($ch1==false)
- {
- echo "<div id='LoginColor'> Accept the trems first!</div>";
- }
- elseif($username==NULL || $password_not_encrypted==NULL || $cPassword==NULL || $email==NULL)
- {
- echo "<div id='LoginColor'> <br/>Please fill all the fields.</div>";
- }
- elseif($password_not_encrypted!=$cPassword)
- {
- echo "<div id='LoginColor'> <br/>The passwords are not the same. </div>";
- }
- /* elseif($at=='@') {
- echo "<div id='LoginColor'> <br />Please enter vaild Email. </div>";
- } */
- //---------------------Check if the username already in use ----------
- $link=mysql_connect('localhost', 'zer0gravUser', 'zer0gravUserPass');
- mysql_select_db('zer0gravity');
- $check=mysql_query("SELECT * FROM users WHERE username='$username';");
- if(mysql_num_rows($check) == 1)
- {
- echo "<br/><div id='LoginColor'> this Username('$username') already taken.</div>";
- }
- $EmailCheckQuery="SELECT email from users WHERE email='$email'";
- $Final=mysql_num_rows($EmailCheckQuery);
- if(mysql_num_rows($EmailCheckQuery)==1) {
- echo "<br/><div id='LoginColor'> This email($email) already in use.</div>";
- }
- mysql_close($link);
- // --------------------------------------------------------------------
- // ------------------ MYSQL SERVER CREATES ACCOUNT -------------------
- if(($username!=NULL || $password_not_encrypted!=NULL || $cPassword!=NULL || $email!=NULL) && ($ch1==true) && ($password_not_encrypted==$cPassword) && (mysql_num_rows($check) != 1) && $Final != 1)
- {
- try {
- $connection=mysql_connect('localhost', 'zer0gravUser', 'zer0gravUserPass');
- mysql_select_db('zer0gravity', $connection);
- $Create_Account = "INSERT INTO users (username, password, email) VALUES('$username', '$password', '$email')";
- $Query = mysql_query($Create_Account, $connection);
- mysql_close($connection);
- }
- catch(Exception $e) {
- die("<p /> Cannot connect to the MySQL server: " . mysql_error());
- echo $e;
- }
- echo "<br />Registered Susscessfuly!<br/>An email sent to you with all your details.";
- echo "<br/>-----<br/>";
- //echo "<br /><a href='Register.php'>[Back]</a>
- //<a href='index.php'>[index]</a>";
- }
- /* mail($email, 'Zer0Gravity details - [Register]', "Hello! Your details :
- Username: $username
- Pasword: $password
- email: $email");
- */
- // ------------------------------------------------------------------------
- echo "<br /><a href='Register.php'>[Back]</a>
- <a href='index.php'>[index]</a>";
- ?>
- </font>
- </center>
- </body>
- </html>
Add Comment
Please, Sign In to add comment