I have a simple chatting system, and what i want to do is put new messages on top of html. My script puts new messages on bottom and i want to change it.
<?php
session_start();
if(isset($_SESSION['name'])){
$text = $_POST['text'];
$text_message = "<div class='msgln'><span class='chat-time'>".date("m.d.y")."</span><br> <b
class='user-name'>".$_SESSION['name']."</b> ".stripslashes(htmlspecialchars($text))."<p></div>";
file_put_contents("../log.html", $text_message, FILE_APPEND | LOCK_EX);
}
?>
The script prints text on the clean log.html file