PHP? ?? ? ????? ???? ?? ?? ? ???? ?? ???, ??? ???? ?? ? ???? ??? ?????. 1) ??? ???? ?? ????? ?????. 2) ??? ??? ????? ??? ??? ????. 3) WordPress, Drupal ? ?? ????? ?? ?????. 4) ? ??? ???? ???? ?? ??? ??????.

??
??? ??? ? ???? ?? ????? ??? ?? ??? ???, PHP? ????? ?? ? ???? ?? ??? ??? ?????. ? ????? PHP? ??? ?? ?? ?? ? ????? ? ??? ? ???? ?? ??????? ?? ? ????. PHP? ????? ?? ? ?????,? ??? ?? ??? PHP? ?? ? ?? ???? ???? ?? ?? ??? ????????.
PHP? ??? ??
PHP? ?? 1994 ? Rasmus Lerdorf? ?? ? ???? ?????? ?? ???? ??????. ??? ??? ?? PHP? ?? ??? ?? ? ???? ??? ??????. ? ??? "?? ????"?? "PHP : HyperText Preprocessor"? ?????, ?? ???? ??? ????? ???? ??? ?????. PHP? ?? ?? ? ?? ??? ???? ??? ???? ?? ? ???? ????????.
PHP? ?? ??? ??? ??, ??? ??? ?? ?? ?? ????? ????, ??? ?? ??? ??? ??? ??? ?? ??? ? ? ????. ?? ??, PHP 5?? ?? ? ?? ?? ????? ??? ??? ?? ?? ???? ?? ????? ??, PHP 7? ??? ?? ???? ???? ?? ? ???? ? ?????.
PHP? ??? ??
PHP? ? ?? ??? ??? ?? ??? ?? ?? ? ???? ????????.
- ?? ? ???? ?? : PHP? ??? ???? ????? ???? ?? ???? ??? ? ????. ??? ?? ??? ????? PHP? ???? ??? ????.
- ??? ???? ?? : PHP?? ??? ??? ??????? ???? ?? ?? ??? ???? ? ??? ? ? ????.
- ?? ?? : WordPress?? Drupal, Magento? ????? ?? ???? ??? ?? ??? ? ?? ??? ???? PHP? ?????.
- ? ???? ??? ?? : PHP? HTML ??? ?? ???? Apache ? Nginx? ?? ? ??? ???? ???? ?? ? ?? ????? ??? ? ? ????.
PHP ?? ?? ????
?? ?? ?????? PHP? ??? ????? ???? ?? ??? ?? ?? ???. ??? ??? ??? ??? ???? ??? ??? ?????? ?? PHP ????? ?????.
<? php
// ($ _server [ "request_method"] == "post") {
$ username = $ _post [ "username"];
$ password = $ _post [ "??"];
// ???? ?? ??? ?? ? ? ????.
?? "????? ???!";
} ? ?? {
Echo "???? ??????. ?? ??????.";
}
}
?>
<! doctype html>
<html>
<??>
<title> ??? ?? </title>
</head>
<body>
<H2> ??? </h2>
<form method = "post"action = "<? php echo htmlspecialchars ($ _ server ["php_self "]);?>">
??? ?? : <input type = "text"name = "username"> <br>
???? : <?? ?? = "????"?? = "????"> <br>
<?? ?? = "??"? = "???">
</form>
</body>
</html>
? ??? PHP ????? ???? ???? ??? ??? ???? ?? ??? ???? ??? ?????. ??? ???? PHP? ??? ??? ????? ?? ?? ? ???? ?? ?? ? ????.
?? ?? ? ?? ??
PHP? ? ???? ??? ?? ?? ?? ?? ? ?? ??? ????? ?? ???? ?? ??? ?? ?? ? ? ????. ? ?? ??? ??? ????.
- ?? ?? ????? ?? : PHP? ?? ?? ?????? ???? ????? ?? ???? ???? ?? ? ? ????. ?? ?? ??? ???? ???? ??
User
???? ?? ? ????.
??? ??? {
?? $ ??? ??;
?? $ ????;
public function __construct ($ username, $ password) {
$ this-> username = $ username;
$ this-> password = $ password;
}
public function authenticate () {
// ???? ?? ??? ?? ? ? ????. $ this-> username == "admin"&& $ this-> password == "password";
}
}
- ??? ?? : Laravel ? Symfony? ?? ??? ??? ?? ??? ???? ? ???? ? ??? ???? ??? ? ?? ???? ? ?? ??? ?? ? ? ????.
- ?? : ??? ??? ?? ? ?
htmlspecialchars
? ?? ??? ???? XSS ??? ???? mysqli
?? PDO
? ?? ??? ???? SQL ??? ??????.
?? ???
?? ???? ???? ?? ? ???? ??? ? ??? ??? ?????. PHP ?? ????? ? ?? ?? ??? ????.
- OpCache ?? : Opcache? PHP ??? ??? ???? ??? ??? ??? ?? ??? ?? ? ????.
- ?????? ?? ??? : ?? ??, ???? ??? ??? ??? ???? ????????? ????.
- CDN ?? : ??? ?? ????? ?? ?????? ????? ?? ??? ?? ? ????.
??
?? ? ???? ???? PHP? ???? ?? ??? ???? ?? ? ???? ?? ?????? ?? ???? ???? ??????. ? ??? ?? PHP? ?? ??? ??? ??? ????? ??? ???? ??? ?? ??? ??????. PHP? ??? ????? ?? PHP? ???? ??? ? ???? ????? ??? PHP? ?? ? ? ???? ??? ? ???? ??? ? ??????.
?? ?? ???? PHP? ???? ??? ??? ??? ??? ???? ? ??? ?? ?? ? ?? ?? ??? ?? ??? ? ??????? ??? ? ????. ???? ??? ??? ?? PHP? ???? ??? ???? ????? ??? ? ??? ??? ?? ? ? ????.
? ??? PHP : ?? ? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!