<!DOCTYPE html><html><body><form action="" method="POST"><input type="text" id="text"><button type="button" id="send"><script>$("#send").click(function() { var text = $("#text").val(); if (text != "") { $.ajax({ type: "GET", url: "request.php", data: { text: text }, cache: false, }); } });</script></body></html>
<?phprequire("data.base.php");$text = htmlentities(strip_tags($_GET['text']));mysqli_query($connect, "INSERT INTO `messages`(`text`) VALUES ('$text')");
<?php$dbhost = 'localhost';$dbname = 'name';$dbpass = 'password';$dbuser = 'user';$connect = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);mysqli_set_charset($connect, "UTF-8");date_default_timezone_set('Asia/Tashkent');
« Mavzuga qaytish