@@ -0,0 +1,86 @@
<html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Testing PHP+MySQL</title>
<link href="../../design/index.css" rel="stylesheet" type="text/css" />
<link href="../../design/table.css" rel="stylesheet" type="text/css" />
<link href="../../design/form.css" rel="stylesheet" type="text/css" />
<script src="../../jsScripts/menu.js" type="text/javascript">
</script>
<script src="../../jsScripts/jquery-3.2.1.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(
function() {
$("#validOnServer").click(() => {
var form = document.querySelector("#formUpdateTable");
if (form.checkValidity()) {
var dataForValid = $("#name").val();
$.ajax({
type: "POST",
url: "updateInfoAboutUser.php",
data: "name=" + dataForValid,
success: function(data) {
$("#valid").html(data);
location.href = "workWithTables.html";
}
});
} else {
document.querySelector('input[type="submit"]').click();
}
});
});
</script>
<style>
.registration-table {
list-style: none;
margin-left: 15px;
line-height: 2;
}
</style>
</head>

<body onload="setHandlerForMenus();">
<div id="container">
<div id="header">
<h1>Обновление данных в таблице MySQL</h1>
</div>
<div id="nav">
<ul>
<li>
<a href="../../index.html">На главную DotaLive</a>
</li>
<li>
<a href="../trollGaben.html">Обзор экспериментов</a>
</li>
<li>
<a href="workWithTables.html">Работа с MySQL</a>
</li>
</ul>
</div>
<div id="text">
<h2>Изменение данных таблицы БД</h2>
<form id="formUpdateTable" name="formUpdateTable" action="" method="POST">
<label for="name">Input data for your name</label>
<input id="name" name="name" type="text" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="enter data here" value="" required/>
<input name="hiddenSubmit" type="submit" value="" hidden />
<input id="validOnServer" name="checkData" type="button" value="Send" />
</form>
<div id="valid"></div>
</div>
<div class="clearfloat"></div>
<div id="footer">
<p>
Эксперименты на PHP+MYSQL | <a href="matches.html">Матчи</a> |
<a href="twitch.html">Любимые стримы</a> |
<a href="hero_records.html">Рекорды</a> |
<a href="things.html">Предметы</a> |
<a href="stata.html">Статистика</a> |
<a href="active.html">Активность</a>
</p>
</div>
</div>
</body>

</html>
@@ -0,0 +1,29 @@
<?PHP
function checkDataOfUser($name){
include "connectToDB.php";
$tableUser = "test";
$data = $name;
if(is_string($data)){
$lengthData = strlen($data);
if($lengthData > 0 && $lengthData <=50){
$query = "UPDATE $tableUser SET name='$data' WHERE name='Кексик'";
$result = mysqli_query($link, $query);
if($result){
print("Success update data");
} else{
print("В таблице ". $tableUser . mysqli_error($link));
}

}else{
print("Данные не удовлетворяют требованиям длины - больше нуля и не больше 50");
}
}else{
print("Данные не являются строкой");
}
mysqli_close($link);
}
if(isset($_POST["name"]) && $_POST["name"] != ''){
checkDataOfUser($_POST["name"]);
}

?>
@@ -0,0 +1,59 @@
<html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Testing PHP+MySQL</title>
<link href="../../design/index.css" rel="stylesheet" type="text/css" />
<link href="../../design/table.css" rel="stylesheet" type="text/css" />
<link href="../../design/form.css" rel="stylesheet" type="text/css" />
<script src="../../jsScripts/menu.js" type="text/javascript">
</script>
<style>
.registration-table {
list-style: none;
margin-left: 15px;
line-height: 2;
}
</style>
</head>

<body onload="setHandlerForMenus();">
<div id="container">
<div id="header">
<h1>Работа с MySQL</h1>
</div>
<div id="nav">
<ul>
<li>
<a href="../../index.html">На главную DotaLive</a>
</li>
<li>
<a href="../trollGaben.html">Обзор экспериментов</a>
</li>
</ul>
</div>
<div id="text">
<h2>Пример работы с таблицами из БД</h2>
<ul class="registration-table">
<li><a href="../../registration.html">Регистрация</a></li>
<li><a href="auth.html">Аутентификация</a></li>
<li><a href="updateInfoAboutUser.html">Изменить личные данные</a></a>
</li>
<li><a href="selectFromTables.php">Вывод содержимого таблиц</a></li>
</ul>
</div>
<div class="clearfloat"></div>
<div id="footer">
<p>
Эксперименты на PHP+MYSQL | <a href="matches.html">Матчи</a> |
<a href="twitch.html">Любимые стримы</a> |
<a href="hero_records.html">Рекорды</a> |
<a href="things.html">Предметы</a> |
<a href="stata.html">Статистика</a> |
<a href="active.html">Активность</a>
</p>
</div>
</div>
</body>

</html>
@@ -0,0 +1,58 @@
<html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Testing PHP+MySQL</title>
<link href="../../design/index.css" rel="stylesheet" type="text/css" />
<link href="../../design/table.css" rel="stylesheet" type="text/css" />
<link href="../../design/form.css" rel="stylesheet" type="text/css" />
<script src="../../jsScripts/menu.js" type="text/javascript">
</script>
<style>
.registration-table {
list-style: none;
margin-left: 15px;
line-height: 2;
}
</style>
</head>

<body onload="setHandlerForMenus();">
<div id="container">
<div id="header">
<h1>Работа с MySQL</h1>
</div>
<div id="nav">
<ul>
<li>
<a href="../../index.html">На главную DotaLive</a>
</li>
<li>
<a href="../trollGaben.html">Обзор экспериментов</a>
</li>
</ul>
</div>
<div id="text">
<h2>Пример работы с таблицами из БД</h2>
<ul class="registration-table">
<li><a href="../../registration.html">Регистрация</a></li>
<li><a href="auth.html">Аутентификация</a></li>
<li><a href="updateInfoAboutUser.html">Изменить личные данные</a></a></li>
<li><a href="printContentOfTableFromDB.php">Вывод содержимого таблиц</a></li>
</ul>
</div>
<div class="clearfloat"></div>
<div id="footer">
<p>
Эксперименты на PHP+MYSQL | <a href="matches.html">Матчи</a> |
<a href="twitch.html">Любимые стримы</a> |
<a href="hero_records.html">Рекорды</a> |
<a href="things.html">Предметы</a> |
<a href="stata.html">Статистика</a> |
<a href="active.html">Активность</a>
</p>
</div>
</div>
</body>

</html>
@@ -11,48 +11,20 @@
<link href="design/form.css" rel="stylesheet" type="text/css" />
<script src="jsScripts/menu.js" type="text/javascript"></script>
<script src="jsScripts/time.js" type="text/javascript"></script>
<script src="jsScripts/form.js" type="text/javascript"></script>
<script language="javascript">
function autofillForm(form) {
function filter(elem) {
var result = true;
// console.log(typeof(elem));
switch (elem) {
case "button":
result = false;
break;
case "submit":
result = false;
break;
case "reset":
result = false;
break;
case "select":
result = false;
break;
default:
result = true;
}
return result;
};
for (var i = 0; i < form.elements.length; i++) {

var el = form.elements[i];
if (filter(el.type) && el.placeholder != undefined) {
el.value = el.placeholder;
console.log(`${el.name} - ${el.placeholder} - ${el.value}`);
}
}
}
window.onbeforeunload = (e) => true;

function callInstallHandlerForElements() {
setHandlerForMenus();
}
</script>
<style>
</style>
</HEAD>

<body onload="callInstallHandlerForElements();">
<div id="container">
<div id="container">
<div id="header">
<h1>Dota2 Live</h1>
</div>
@@ -79,44 +51,60 @@ <h1>Dota2 Live</h1>
<li>
<a href="active.html">Активность</a>
</li>
<li>
<li>
<a href="registration.html">Регистрация</a>
</li>
</ul>
</div>
<div id="text">
<h1>Личная информация</h1>
<h2>Заполните следующие поля</h2>
<form name="form1" oninput="heightoutput.value=height.value" action="refreshPage/testingPHP+MYSQL/echoPostRegistration.php" method="POST">
<!--123 ФИО-->
<label for="firstName">Фамилия:</label>
<input type="text" id="firstName" name="firstName" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="Кулаков" required><br>
<label for="secondName">Имя:</label>
<input type="text" id="secondName" name="secondName" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="Григорий" required><br>
<label for="thirdName">Отчество:</label>
<input type="text" id="thirdName" name="thirdName" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="Викторович" required><br>
<!--4 телефон pattern="(\+?\d[- .]*){7,13}"-->
<label for="phone">Номер сотового телефона:+7</label>
<input type="tel" id="phone" name="phone" pattern="(\d{3}-){2}\d{2}-\d{2}" placeholder="951-592-29-51" required><br>
<!--5 мыло-->
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="mail" pattern="[^@]+@[^@]+\.[a-zA-Z]{2,3}" placeholder="kulakov-griha96@ya.ru" required><br>
<!--6 паспортные данные-->
<label for="passport">Серия и номер паспорта:</label>
<input type="tel" id="passport" name="passport" pattern="\d{4}-\d{6}" placeholder="1857-845987" required><br>
<!--7 номер карты-->
<label for="card">Номер банковской карты:</label>
<input type="tel" name="card" placeholder="5464-1110-1093-1106" pattern="(\d{4}-){3}\d{4}" required><br>
<!--8 дата рождения-->
<label for="birthDay">Дата рождения:</label>
<input type="date" id="birthDaty" name="birthDay" required placeholder="1996-05-28"><br>
<!--9 рост-->
<label for="height">Рост:</label>
<output name="heightoutput">178</output>
<input type="range" id="height" name="height" min="40" max="300" value="178" placeholder="178"><br>
<!--10 ос на компе-->
<label for="os">ОС на компе:</label>
<select id="os" multiple name="os[]">
<div id="text">
<h1>Личная информация</h1>
<h2>Заполните следующие поля</h2>
<form name="form1" oninput="heightoutput.value=height.value" action="refreshPage/testingPHP+MYSQL/echoPostRegistration.php" method="POST">
<fieldset>
<legend>Придумайте логин и пароль</legend>
<!--Login-->
<label for="login">Логин:</label>
<input name="login" type="text" value="" id="login" pattern="[a-z0-9]{6,25}" placeholder="gregory322" /><br>
<!--Password-->
<!--Требования к паролю: Минимум 8 символов, одна цифра,одна буква в верхнем регистре и одна в нижнем-->
<label for="password">Пароль:</label>
<input name="password" type="password" value="" id="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,32}" placeholder="QwertY322U228" /><br>
</fieldset>

<fieldset>
<legend>Заполните обязательную личную информацию</legend>
<!--123 ФИО-->
<label for="firstName">Фамилия:</label>
<input type="text" id="firstName" name="firstName" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="Кулаков" required><br>
<label for="secondName">Имя:</label>
<input type="text" id="secondName" name="secondName" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="Григорий" required><br>
<label for="thirdName">Отчество:</label>
<input type="text" id="thirdName" name="thirdName" pattern="[А-Я]{1}[а-я]{1,50}" placeholder="Викторович" required><br>
<!--4 телефон pattern="(\+?\d[- .]*){7,13}"-->
<label for="phone">Номер сотового телефона:+7</label>
<input type="tel" id="phone" name="phone" pattern="(\d{3}-){2}\d{2}-\d{2}" placeholder="951-592-29-51" required><br>
<!--5 мыло-->
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="mail" pattern="[^@]+@[^@]+\.[a-zA-Z]{2,3}" placeholder="kulakov-griha96@ya.ru" required><br>
<!--6 паспортные данные-->
<label for="passport">Серия и номер паспорта:</label>
<input type="tel" id="passport" name="passport" pattern="\d{4}-\d{6}" placeholder="1857-845987" required><br>
<!--7 номер карты-->
<label for="card">Номер банковской карты:</label>
<input type="tel" name="card" placeholder="5464-1110-1093-1106" pattern="(\d{4}-){3}\d{4}" required><br>
<!--8 дата рождения-->
<label for="birthDay">Дата рождения:</label>
<input type="date" id="birthDaty" name="birthDay" required placeholder="1996-05-28"><br>
</fieldset>
<fieldset>
<legend>Дополнительная информация</legend>
<!--9 рост-->
<label for="height">Рост:</label>
<output name="heightoutput">178</output>
<input type="range" id="height" name="height" min="40" max="300" value="178" placeholder="178"><br>
<!--10 ос на компе-->
<label for="os">ОС на компе:</label>
<select id="os" multiple name="os[]">
<option disabled>Выберите ОС на компе</option>
<option value="Gentoo" selected>Gentoo</option>
<option value="XP">Windows XP</option>
@@ -127,14 +115,14 @@ <h2>Заполните следующие поля</h2>
<option value="Win10">Windows 10</option>
<option value="Debian">Debian</option>
</select><br>
<!--11 любимый браузер-->
<label>Любимый браузер:</label>
<input type="radio" name="loveBrowser" value="chrome" checked>Google Chrome
<input type="radio" name="loveBrowser" value="firefox">Mozilla Firefox
<input type="radio" name="loveBrowser" value="opera">Opera<br>
<!--12 знакомые яп-->
<label for="familiarLP">Знакомые языки программирования:</label>
<select id="familiarLP" multiple name="LP[]">
<!--11 любимый браузер-->
<label>Любимый браузер:</label>
<input type="radio" name="loveBrowser" value="chrome" checked>Google Chrome
<input type="radio" name="loveBrowser" value="firefox">Mozilla Firefox
<input type="radio" name="loveBrowser" value="opera">Opera<br>
<!--12 знакомые яп-->
<label for="familiarLP">Знакомые языки программирования:</label>
<select id="familiarLP" multiple name="LP[]">
<option disabled>Выберите Знакомый язык программирования</option>
<option value="fsharp" selected>F#</option>
<option value="csharp">C#</option>
@@ -144,36 +132,38 @@ <h2>Заполните следующие поля</h2>
<option value="python">Python</option>
<option value="Haskell">Haskell</option>
</select><br>
<!--13 любимая парадигма программирования-->
<label for="loveP">Любимая парадигма программирования:</label>
<select id="loveP" name="P">
<!--13 любимая парадигма программирования-->
<label for="loveP">Любимая парадигма программирования:</label>
<select id="loveP" name="P">
<option disabled>Выберите парадигму</option>
<option value="fp" selected>Функциональная</option>
<option value="oop">Объектно-ориентированная</option>
<option value="proc">Императивная</option>
<option value="logic">Логическая</option>
<option value="define">Декларативная</option>
</select><br>
<!--14 родной язык-->
<label for="nativeLang">Родной язык</label>
<select id="nativeLang" name="nativeLang">
<!--14 родной язык-->
<label for="nativeLang">Родной язык</label>
<select id="nativeLang" name="nativeLang ">
<option disabled>Выберите язык</option>
<option value="ru" selected>Русский</option>
<option value="en">Английский</option>
<option value="jp">Японский</option>
</select><br>
<!--15 веб-сайт-->
<label for="site">Ваш сайт:</label>
<input type="url" id="site" name="site" placeholder="http://www.vk.com/mardlockscramble"><br>
<!--check data-->
<input type="submit" name="check" value="Проверить">
<!--автозаполнение формы-->
<button name="autofill" onclick="autofillForm(document.forms[0]);">Автозаполнение &#128526</button>
<!--reset value-->
<input type="reset" name="reset" value="Сбросить">
</form>
</div>
<div id="news">
<!--15 веб-сайт-->
<label for="site">Ваш сайт:</label>
<input type="url" id="site" name="site" placeholder="http://www.vk.com/mardlockscramble"><br>
</fieldset>

<!--check data-->
<input type="submit" name="check" value="Проверить">
<!--автозаполнение формы-->
<button name="autofill" onclick="autofillForm(document.forms[0]);">Автозаполнение &#128526</button>
<!--reset value-->
<input type="reset" name="reset" value="Сбросить">
</form>
</div>
<div id="news">
<h3>Обзор профиля</h3>
<ul>
<li>
@@ -231,4 +221,4 @@ <h3>Текущее время</h3>
</div>
</body>

</HTML>
</HTML>