I can't find the AJAX one, so I'll write another.
Save as disp.php:
Put the JavaScript and Iframe on the page where you want the alert to appear:PHP Code:<?php
header("Cache-Control: no-cache, must-revalidate");
session_start();
if(!isset($_SESSION['alert'])) {
$_SESSION['alert'] = 'no_message';
}
$handle = fopen('message.txt', 'r');
$message = fread($handle, filesize('message.txt'));
fclose($handle);
if($message != $_SESSION['alert']) {
print '<script type="text/JavaScript">alert(\''.$message.'\');</script>';
$_SESSION['alert'] = $message;
}
?>
(Tweak the time etc).HTML Code:<html> <head> <script> function update() { document.getElementById('display_alert').src = 'disp.php'; setTimeout('update()', 10000); } </script> </head> <body onLoad="update();"> <iframe id="display_alert" style="display: none" src="disp.php"></iframe> </body> </html>
Then when you want to send out a message, just change the text inside a file named message.txt. If you want a panel to edit the message, then just say and I'll make one.


Reply With Quote

- i dont give up


