Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL ^ E_DEPRECATED);
- session_start();
- ?>
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="he" lang="he" >
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta name="robots" content="index,follow" />
- <link rel="stylesheet" href="css/stayl.css">
- <title>register</title>
- </head>
- <body>
- <div class="whe">
- <form action="" method="post">
- <div class="input">
- <input type="text" name="fullname"
- placeholder="enter name">
- <input type="text" name="username"
- placeholder="enter uesrname" >
- <div class="input" >
- <input type="password" name="pass"
- placeholder="enter password">
- <input type="password" name="repass"
- placeholder="Confirm Password" >
- <br/>
- <input type="text" name="email"
- placeholder="enter emil" >
- </div>
- <input type="submit" name="signup"
- value="register" class="bat-login">
- <br>
- <br />
- </form>
- <?php
- $con = mysql_connect('','','karpel') or die('not 1 ');
- mysql_select_db('',$con) or die('not ');
- if(isset($_POST['signup'])){
- $fullname = $_POST['fullname'];
- $username = $_POST['username'];
- $pass = $_POST['pass'];
- $repass = $_POST['repass'];
- $email = $_POST['email'];
- $code = rand(11111111,99999999);
- $pass = md5 ($pass);
- $repass = md5 ($repass);
- if(empty($username)){
- echo "חובה למלא שם משתמש";
- }else{
- $checkUser = mysql_query("SELECT `username` FROM `users3` WHERE `username` = '" .$username. "'");
- if(mysql_num_rows($checkUser)){
- echo "שם המשתמש <strong>{$username}</strong> קיים במערכת";
- }else{
- if(empty($fullname)){
- echo "יש לציין שם מלא להרשמה";
- }elseif(!empty($pass) && !empty($repass)){
- if($pass != $repass){
- echo "הסיסמאות אינן תואמות";
- }elseif($pass == $username){
- echo "אימות סיסמא לא נכון";
- }elseif{
- $checkEmail = mysql_query("SELECT `email` FROM `users3` WHERE `email` = '" .$email. "'");
- if(mysql_num_rows($checkEmail)){
- echo "האימייל שהזנתה קיים במערכת";
- }else{
- mysql_query("INSERT INTO `users3` (`fullname`,`username`,`pass`,`email`,`code`,`active`) VALUES('" .$fullname. "','" .$username. "','" .$pass. "','" .$email. "','" .$code. "','0')");
- echo "Hello, <strong>{$username}</strong> registered successfully !! , Please check your email ($email) to verify your email !";
- }
- }
- }
- }
- }
- }
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement