<html>
<head>
<title>Speak</title>
</head>
<body>
<?php
if ($words){
$link = mysqli_connect('localhost', 'xxx', 'xxx', 'ChatRoom');
$time = date('Y-m-d-a:i:s');
$str = "INSERT INTO chat(chtime,nick,words) values('$time','$nick','$words')" ;
mysqli_query($str,$link);
mysqli_close($link);
}
?>
<form action = "Speak.php" method = "post" target = " _self">
<input type = "text" name = "words" cols="20">
<input type = "submit" value = "Speak">
</form>
</body>
</html>