I'm having some problems updating a div without updating the entire page. Here is the code:
<div class="main" align="justify">
<div id="mensagens">
<?php echo file_get_contents('arquivo.txt'); ?>
</div>
...
I've thought about creating a "frame" - I'm not sure if that would be the name - and use "meta refresh" to update within it.
My question is: How to update this Div using PHP or Javascript? And if possible, how would you update this Div whenever there is a change in the ".txt file"?
Update
The ".txt file" is updated normally:
$texto = htmlspecialchars($_POST['text']);
$string = $texto . "\n";
$fp = fopen('arquivo.txt', 'a');
$fw = fwrite($fp, $string);
fclose($fp);