This file contains hidden or 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> | |
| <meta charset="utf-8"> | |
| <title>Города</title> | |
| </head> | |
| <body> | |
| <form method="POST" action="city.php"> | |
| Город: <br> | |
| <input type="text" name="city"/><br> |
This file contains hidden or 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 | |
| try | |
| { | |
| $pdo = new PDO("mysql:host=localhost;dbname=joke_db", "root", ""); | |
| $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| $pdo->exec('SET NAMES "utf8"'); | |
| } | |
| catch (PDOException $e) | |
| { | |
| $output = 'Невозможно подключиться к серверу баз данных :('. " <br>" .$e->getMessage(); |
This file contains hidden or 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 | |
| header('Content-Type: text/html; charset=utf-8'); | |
| class Cars{ | |
| public $mark;// марка | |
| public $type; // тип | |
| public $tonnage; // тонаж | |
| } | |
| class Truck extends Cars { | |
| public function __construct(){ | |
| echo $this->mark = "MAN "; |
This file contains hidden or 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 | |
| header('Content-Type: text/html; charset=utf-8'); | |
| class Cars{ | |
| protected $mark;// марка | |
| public $type; // тип | |
| public $tonnage; // тонаж | |
| protected $places; // места | |
| public function setMark($mark,$places){ | |
| echo $mark . " " . $places . " мест"; | |
| } |
This file contains hidden or 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 | |
| include_once("connectDatabases.php"); | |
| ?> | |
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Добовление товаров</title> | |
| </head> | |
| <body> |
This file contains hidden or 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 | |
| include_once("connectDatabases.php"); | |
| if(isset($_POST['add_categories'])) { | |
| $parent_id = $_POST['parent_id'] ; | |
| $name = $_POST['add_categories']; | |
| mysql_query("INSERT INTO categories (parent_id, name) VALUES('$parent_id','$name')"); | |
| header('Location: '.$_SERVER['PHP_SELF']); | |
| exit; | |
| } |
This file contains hidden or 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 | |
| //phpinfo(); exit; | |
| header('Content-Type: text/html; charset=utf-8'); | |
| $a = array( | |
| array( | |
| "id" => 1, | |
| "parent_id" => 0, | |
| "name" => "Электротовары" | |
| ), |
This file contains hidden or 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 | |
| //phpinfo(); exit; | |
| header('Content-Type: text/html; charset=utf-8'); | |
| $a = array( | |
| array( | |
| "id" => 1, | |
| "parent_id" => 0, | |
| "name" => "Электротовары" | |
| ), |
This file contains hidden or 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 | |
| //phpinfo(); exit; | |
| header('Content-Type: text/html; charset=utf-8'); | |
| $a = array( | |
| array( | |
| "id" => 1, | |
| "parent_id" => 0, | |
| "name" => "Электротовары" | |
| ), | |
| array( |
This file contains hidden or 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 | |
| include_once("connectDatabases.php"); | |
| class GuestBook{ | |
| private $firstName; | |
| private $email; | |
| private $message; | |
| function __construct($firstName,$email,$message){ | |
| $this->firstName = $firstName; | |
| $this->email = $email; | |
| $this->message = $message; |