Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title> Registruoti paskyra </title></head>
- <body>
- <form action="Registers.php" method="POST">
- Username: <input type="text" name="username">
- <br />Password: <input type="password" name="password">
- <br/><input type="submit" name="submit" value="registracija"> or <a href="Login.php"> Prisijungti</a>
- </form>
- </body>
- </html>
- <?php
- $username = @$_POST['username'];
- $password = @$_POST['password'];
- if(isset($_POST['submit'])){
- if($username && $password) {
- if(strlen($username) >=3 && strlen($username) < 25 && strlen($password) > 4){
- if($query =("INSERT INTO registracija(`id`, `username`, `password`) VALUES ('', '".$username."', '".$password."')")) {
- echo "Buvai uzregistruotas kaip $username. Paspausk <a href='login.php'> cia </a> prisijungti";
- } else {
- echo "slaptazodis neatitinka";
- }
- }else{
- if(strlen($username) < 3 || strlen($username) > 25){
- echo "vartotojo vardas turi susidaryti nuo 3 iki 25 simboliai";
- }
- if(strlen($password)<4) {
- echo "<br />slaptazodis turi byti ilgesnis nei 4 simboliai";
- }
- }
- }else {
- echo "prasau uzpildyti visus laukus";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement