$mysqli->query("INSERT INTO `cansus` (`name` , `text`, `date`) VALUES ('$name' , '$text', NOW())");
Дату отправляю в базу как обычно через hidden вот таким образом
var container = document.getElementById("load_div");
var str = container.innerText;
var words = str.split(/\s/);
while (container.hasChildNodes()) {
container.removeChild(container.lastChild);
}
words.forEach(function (item,idx) {
var el = document.createElement('p');
el.setAttribute("class","chat");
el.innerText = item;
container.appendChild(el);
} )
if(isset($_POST['btn']) and !empty($_POST['mytext']))
{
$mytext = $_POST['mytext'];
file_put_contents('123.txt', PHP_EOL . $mytext, FILE_APPEND);
}
var width = document.documentElement.clientWidth;
if (width > 992) {
document.location.href = "http://google.com";
}