Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ERROR);
- require('config.php');
- if(isset($_POST['submit'])){
- $email1 = $_POST['email'];
- $email2 = $_POST['email2'];
- $pass1 = $_POST['pass1'];
- $pass2 = $_POST['pass2'];
- $uname = $_POST['uname'];
- if($email1 == $email2){
- if($pass1 == $pass2){
- mysql_query( "insert into users(id,name,lname,uname,email,pass) values(null,'".$_REQUEST['name']."','".$_REQUEST['lname']."','".$_REQUEST['uname']."', '".$_REQUEST['email']."', MD5($pass1))") or die(mysql_error());
- $sql = 'SELECT uname FROM users WHERE uname = $uname';
- if(mysql_num_rows($sql) >0){
- echo "Sorry, that user already existus.";
- exit();
- }
- }else{
- echo "Sorry , your password do not mach.<br/>";
- exit();
- }
- }else{
- echo "Sorry , your email do not mach.<br/>";
- }}
- else{
- $form = <<<EOT
- <form action="register.php" method="POST" >
- First Name: <input type="text" name="name"/><br/>
- Last Name: <input type="text" name="lname"/><br/>
- UserName: <input type="text" name="uname"/><br/>
- Email: <input type="text" name="email"/><br/>
- Confirm Email: <input type="text" name="email2"/><br/>
- Password: <input type="password" name="pass1"/><br/>
- Confirm Password: <input type="password" name="pass2"/><br/>
- <input type="submit" name="submit" value="Register">
- </form>
- EOT;
- echo $form;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement