Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL ^ E_DEPRECATED);
  3. session_start();
  4.  
  5. ?>
  6. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="he" lang="he" >
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  9. <meta name="robots" content="index,follow" />
  10. <link rel="stylesheet" href="css/stayl.css">
  11. <title>register</title>
  12. </head>
  13. <body>
  14. <div class="whe">
  15. <form action="" method="post">
  16. <div class="input">
  17. <input type="text" name="fullname"
  18. placeholder="enter name">
  19. <input type="text" name="username"
  20. placeholder="enter uesrname" >
  21.  
  22. <div class="input" >
  23. <input type="password" name="pass"
  24. placeholder="enter password">
  25. <input type="password" name="repass"
  26. placeholder="Confirm Password" >
  27. <br/>
  28. <input type="text" name="email"
  29. placeholder="enter emil" >
  30. </div>
  31. <input type="submit" name="signup"
  32. value="register" class="bat-login">
  33. <br>
  34.  
  35.  
  36. <br />
  37. </form>
  38. <?php
  39. $con = mysql_connect('','','karpel') or die('not 1 ');
  40. mysql_select_db('',$con) or die('not ');
  41.  
  42. if(isset($_POST['signup'])){
  43. $fullname = $_POST['fullname'];
  44. $username = $_POST['username'];
  45. $pass = $_POST['pass'];
  46. $repass = $_POST['repass'];
  47. $email = $_POST['email'];
  48. $code = rand(11111111,99999999);
  49. $pass = md5 ($pass);
  50. $repass = md5 ($repass);
  51.  
  52.  
  53.  
  54.  
  55. if(empty($username)){
  56. echo "חובה למלא שם משתמש";
  57.  
  58. }else{
  59. $checkUser = mysql_query("SELECT `username` FROM `users3` WHERE `username` = '" .$username. "'");
  60. if(mysql_num_rows($checkUser)){
  61. echo "שם המשתמש <strong>{$username}</strong> קיים במערכת";
  62. }else{
  63. if(empty($fullname)){
  64. echo "יש לציין שם מלא להרשמה";
  65. }elseif(!empty($pass) && !empty($repass)){
  66. if($pass != $repass){
  67. echo "הסיסמאות אינן תואמות";
  68. }elseif($pass == $username){
  69.  
  70. echo "אימות סיסמא לא נכון";
  71. }elseif{
  72.  
  73.  
  74. $checkEmail = mysql_query("SELECT `email` FROM `users3` WHERE `email` = '" .$email. "'");
  75. if(mysql_num_rows($checkEmail)){
  76. echo "האימייל שהזנתה קיים במערכת";
  77.  
  78. }else{
  79.  
  80.  
  81. mysql_query("INSERT INTO `users3` (`fullname`,`username`,`pass`,`email`,`code`,`active`) VALUES('" .$fullname. "','" .$username. "','" .$pass. "','" .$email. "','" .$code. "','0')");
  82. echo "Hello, <strong>{$username}</strong> registered successfully !! , Please check your email ($email) to verify your email !";
  83.  
  84. }
  85.  
  86. }
  87.  
  88.  
  89.  
  90.  
  91. }
  92. }
  93. }
  94.  
  95. }
  96. }
  97. ?>
  98. </div>
  99. </body>
  100. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement