Skip to content

Instantly share code, notes, and snippets.

View VictorFursa's full-sized avatar
🙃
Focusing

Victor Fursa VictorFursa

🙃
Focusing
View GitHub Profile
<?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"];
@VictorFursa
VictorFursa / error
Last active January 12, 2016 12:19
<?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);
<?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;
<?php
class Db{
private $server = 'localhost';
private $userName = 'root';
private $passwrod = '';
private $select = 'catalog';
private $charset = "utf8";
private $sql = "";
function __construct(){
$this->sql();
<?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;
<?php
//phpinfo(); exit;
header('Content-Type: text/html; charset=utf-8');
$a = array(
array(
"id" => 1,
"parent_id" => 0,
"name" => "Электротовары"
),
array(
<?php
//phpinfo(); exit;
header('Content-Type: text/html; charset=utf-8');
$a = array(
array(
"id" => 1,
"parent_id" => 0,
"name" => "Электротовары"
),
<?php
//phpinfo(); exit;
header('Content-Type: text/html; charset=utf-8');
$a = array(
array(
"id" => 1,
"parent_id" => 0,
"name" => "Электротовары"
),
<?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;
}
<?php
include_once("connectDatabases.php");
?>
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<title>Добовление товаров</title>
</head>
<body>