Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <html>
  2. <head><title> Registruoti paskyra </title></head>
  3. <body>
  4. <form action="Registers.php" method="POST">
  5. Username: <input type="text" name="username">
  6. <br />Password: <input type="password" name="password">
  7. <br/><input type="submit" name="submit" value="registracija"> or <a href="Login.php"> Prisijungti</a>
  8. </form>
  9. </body>
  10. </html>
  11. <?php
  12. $username = @$_POST['username'];
  13. $password = @$_POST['password'];
  14.  
  15. if(isset($_POST['submit'])){
  16. if($username && $password) {
  17. if(strlen($username) >=3 && strlen($username) < 25 && strlen($password) > 4){
  18.  
  19. if($query =("INSERT INTO registracija(`id`, `username`, `password`) VALUES ('', '".$username."', '".$password."')")) {
  20. echo "Buvai uzregistruotas kaip $username. Paspausk <a href='login.php'> cia </a> prisijungti";
  21. } else {
  22. echo "slaptazodis neatitinka";
  23. }
  24. }else{
  25. if(strlen($username) < 3 || strlen($username) > 25){
  26. echo "vartotojo vardas turi susidaryti nuo 3 iki 25 simboliai";
  27. }
  28. if(strlen($password)<4) {
  29. echo "<br />slaptazodis turi byti ilgesnis nei 4 simboliai";
  30. }
  31. }
  32. }else {
  33. echo "prasau uzpildyti visus laukus";
  34.  
  35. }
  36.  
  37. }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement