-
-
Save jamzy118/1400e51095302db8ea0e10b7574ccac4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Validate { | |
public $login; | |
public function __construct($login){ | |
$this->login = $login; | |
} | |
} | |
class Length extends Validate{ | |
public function checkLength(){ | |
if(strlen($this->login) < 5){ | |
echo "login jest za krótki"; | |
} | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>writers - rejestracja</title> | |
</head> | |
<body> | |
<form action="#" method="post"> | |
<div class="input"> | |
Login: <input type="text" name="login"> | |
</div> | |
<div class="input"> | |
Hasło: <input type="password" name="password"> | |
</div> | |
<div class="input"> | |
<input type="submit" value="Wyślij" name="sub"> | |
</div> | |
</form> | |
<?php | |
if(isset($_POST['sub'])){ | |
require_once 'core/init.php'; | |
$v = new Length($_POST['login']); | |
$v->checkLength(); | |
/*Warning: require_once(classes/Length.php): failed to open stream: No such file or directory in C:\xampp\htdocs\writers\core\init.php on line 3 | |
Fatal error: require_once(): Failed opening required 'classes/Length.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\writers\core\init.php on line 3*/ | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment