Code:
<?php
if (isset($_GET['update'])) {
$m = $_POST['message'];
if ($_POST['pass']=='mypasswordhere!') {
$f = fopen('message.txt','w+');
fwrite($f,$m);
fclose($f);
}
}
?>
//don't change above
//but change formatting below if you want
//and add proper formatting, like <html>, etc.
<form action="?update" method="post">
Password: <input type="password" name="pass"><br>
Message: <textarea name="message"><?php echo @$m; ?></textarea>
</form>
Then include the .txt file into your bar at the top--
<?php include('message.txt'); ?>
However, if you want it to load automatically--
1. Just refresh the page every 5 seconds, though this is kinda annoying.
2. Or, use AJAX to script it to check the message every few seconds then update if it's new.
Bookmarks