Advertisement
Guest User

вел логин а оно пишет ведите логин опять

a guest
May 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <?php
  2. require "db.php";
  3.  
  4. $data = $_POST;
  5. if ( isset($data['do_signup']) ){
  6. //здесь регистрация
  7. $errors = array();
  8.  
  9. if ( trim($data['login']) == '' )
  10. {
  11. $errors[] = 'Ведите логин';
  12. }
  13. //log
  14. if ( trim($data['email']) == '' ){
  15. $errors[] = 'Ведите email';
  16. }//emal
  17. if ( $data['password'] == '' ){
  18. $errors[] = 'Ведите пароль';
  19. }//pass
  20. if( $data['password_2'] != $data ['password'])
  21. {
  22. $errors[] = 'Повторный пароль веден не верно';
  23. }
  24. if( empty($errors) )
  25. {
  26. //все збс
  27. } else
  28. {
  29. echo '<div style="color: red;">' .array_shift($errors).'</div><hr>';
  30. }
  31.  
  32.  
  33.  
  34. }
  35.  
  36. ?>
  37. <form action="/signup.php" method="POST">
  38. <p>
  39. <p><strong>Ваш логин</strong>:</p>
  40. <input type="text" name"login">
  41. </p>
  42.  
  43. <p>
  44. <p><strong>Ваш Email</strong>:</p>
  45. <input type="email" name"email">
  46. </p>
  47.  
  48. <p>
  49. <p><strong>Ваш пароль</strong>:</p>
  50. <input type="password" name"password">
  51. </p>
  52.  
  53. <p>
  54. <p><strong>Введите пароль еще раз</strong>:</p>
  55. <input type="password_2" name"password_2">
  56. </p>
  57.  
  58. <p>
  59. <button type="submit" name="do_signup"> Зарегистрироваться </button>
  60. </p>
  61.  
  62.  
  63. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement