Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- echo "Register!";
- $submit = $_submit['submit'];
- $fullname = strip_tags($_POST['fullname']);
- $password = strip_tags($_POST['password']);
- $passwordrepeat = strip_tags($_POST['passwordrepeat']);
- $username = strip_tags($_POST['username']);
- $email = strip_tags($_POST['email']);
- $date = date("Y-m-d");
- $connect = mysql_connect("hidden","hidden","hidden") or die("Couldn't connect to server!");
- $lastid = mysql_query("SELECT id FROM users WHERE username='$username'");
- mysql_select_db("hidden") or die ("Unable to find database!");
- $namecheck = mysql_query("SELECT username FROM users WHERE username='$username'");
- $count = mysql_num_rows($namecheck);
- $activated = '1';
- $random = rand(1,999999999);
- if ($submit)
- {
- if ($count!=0)
- {
- if($username && $password && $passwordrepeat && $fullname && $email)
- {
- if (strlen($fullname)>255)
- {
- if (strlen($username)>25)
- {
- if (strlen($password)>25||strlen($passwordrepeat)<6)
- {
- if ($password==$passwordrepeat)
- {
- $passwordresend = $password;
- $password = md5($_POST['password']);
- $passwordrepeat = md5($_POST['passwordrepeat']);
- $queryreg = mysql_query("INSERT INTO users ('id','username','password','email','name','time','passwordresend','randnum','activated') VALUES('','$username','$password','$email','$fullname','$date','$passwordresend','$random','$activated')");
- echo "Registration Complete!";
- die();
- }
- die("The passwords does not match!");
- }
- die("Your password must be between 6 and 25 characters!");
- }
- die("Your username is too long!");
- }
- die("Your fullname is too long!");
- }
- die("Please enter <b>all</b> values!");
- }
- die("Username already taken!");
- }
- ?>
- <form action='register.php' method='POST'>
- <p>
- <table>
- <tr>
- <td>
- Your full name:
- </td>
- <td>
- <input type='text' name='fullname' value='<?php echo $fullname ?>'>
- </td>
- </tr>
- <tr>
- <td>
- Your E-mail:
- </td>
- <td>
- <input type='text' name='email' value='<?php echo $email ?>'>
- </td>
- </tr>
- <tr>
- <td>
- Username:
- </td>
- <td>
- <input type='text' name='username' value='<?php echo $username ?>'>
- </td>
- </tr>
- <tr>
- <td>
- Password:
- </td>
- <td>
- <input type='password' name='password'>
- </td>
- </tr>
- <tr>
- <td>
- Repeat password:
- </td>
- <td>
- <input type='password' name='passwordrepeat'>
- </td>
- </tr>
- </table>
- <p>
- <input type='submit' name='submit' value='Register'>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement