Im new to PHP...Im tryin to make a script that will allow users on my site to send "pages" to each other. When user A sends user B a "page", a text file is created with the message in user B's member folder. I created a hidden frame that has a while loop that checks to see if a "pager" text file has been created in their folder, and displays the contents if one does. The while loop isn't working. Its crashing my browser because of the forever loop. Anyone have an idea of an easier way I can do this?
Here is an example of the code I used:
while (true) {
$contents = fread($checknote, filesize($notefile));
if (file_exists("$notefile")) {
$checknote = fopen($notefile,"r");
$content = $contents;
?>
<script>
window.open('<?php print "readnote.php"; ?>',
'page', 'width=200,height=320,scrollbars=yes');
</script>
<?
fclose($checknote);
unlink("$notefile");
}
}
fclose($checknote);
?>