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"); | |
$connect = mysql_connect('localhost', 'root', '') | |
or die('Не удалось соединиться: ' . mysql_error()); | |
mysql_select_db('alcoholic') or die('Не удалось выбрать базу данных'); | |
mysql_set_charset("utf8"); | |
if(isset ($_POST["submit"])) { | |
if(isset($_POST["yes"])){ | |
$userName = $_POST["userName"]; | |
$login = $_POST["login"]; |
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 | |
class Db{ | |
private $server = 'localhost'; | |
private $userName = 'root'; | |
private $passwrod = ''; | |
private $select = 'catalog'; | |
private $charset = "utf8"; | |
private $sql = ""; | |
function __construct(){ | |
mysql_connect($this->server, $this->userName,$this->passwrod); |
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"); | |
include_once("Db.php"); | |
class GuestBook{ | |
private $firstName; | |
private $email; | |
private $message; | |
function __construct($db,$firstName,$email,$message){ | |
$this->db = $db; | |
$this->firstName = $firstName; |
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 | |
class Db{ | |
private $server = 'localhost'; | |
private $userName = 'root'; | |
private $passwrod = ''; | |
private $select = 'catalog'; | |
private $charset = "utf8"; | |
private $sql = ""; | |
function __construct(){ | |
$this->sql(); |
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; |
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 | |
//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 | |
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 | |
include_once("connectDatabases.php"); | |
?> | |
<!DOCTYPE> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Добовление товаров</title> | |
</head> | |
<body> |