<?php
if (!$p_file = fopen("inputfile.txt","r")) {
echo "Spiacente, non posso aprire il file miofile.txt";
} else {
$linea = fgets($p_file, 255);
echo "$linea<BR>";
fclose($p_file);
}
$content = file('inputfile.txt');
array_splice($content, 0, 1);
file_put_contents('inputfile.txt', $content);
?>
---------------------------------------------------------------------------
and this is my javascript inside html with ajax
------------------------------------------------------------------------
<script type="text/javascript">
function updateTopic() {
$.ajax({
type: "POST",
url : 'script.php',
dataType: "text",
success: function (data) {
$("#risultato").html(data);
// var $html = $.trim(data);
// var $document = $.parseHTML($html);
// var mah=data.toString();
if( $.trim(data) == "ok"){
....my code....
}
}
});
}
setInterval("updateTopic()", 2000);
</script>
-------------------------------------------------------------------------------
can anyone help me?
thanks Roberto