Well, you could set up a flat file shout box. Here is a flate file shout box i wrote a while back.
1. Save this file as index.html
CODE
<html>
<head>
<title>Shout Box</title>
</head>
<body>
<center>
<form method="post" action="post.php">
<iframe src="shouts.html" scrolling="auto"></iframe><br />
<input type="text" name="name" value="Name" onfocus="if(this.value=='Name'){this.value=''}" onblur="if(this.value==''){this.value='Name'}" /><br />
<input type="text" name="message" value="Message" onfocus="if(this.value=='Message'){this.value=''}" onblur="if(this.value==''){this.value='Message'}" /><br />
<input type="submit" name="post" value="Post Comment" />
</form>
</center>
</body>
</html>
2. Save a blank file as shouts.html and CHMOD the file to 777.
3. Save this file as post.php
CODE
<?php
if (isset($_POST['name']) && isset($_POST['message'])) {
if ($_POST['name'] != 'Name') {
if ($_POST['message'] != 'Message') {
$name = str_replace(';', '.', $_POST['name']);
$message = str_replace(';', '.', $_POST['message']);
if (@file_exists('shouts.html')) {
if (@is_writable('shouts.html')) {
$fp = @fopen('shouts.html', 'a+');
if (!@fputs($fp, stripslashes('<br><font color="red">' . $name . ',</font><font color="#000000"> ' . $message . '</font>'))) {
echo 'Could not write to text, please set the permissions right.';
} else {
header('Location: index.html');
}
} else {
if (@chmod('shouts.html', 777)) {
$fp = @fopen('shouts.html', 'a+');
if (!@fputs($fp, stripslashes(';' . $name . ', ' . $message))) {
echo 'Could not write to shouts.html, please set the permissions right.';
} else {
header('Location: index.html');
}
} else {
echo 'shouts.html is not writable, we attempted to CHMOD it to 777 and it failed, please manually CHMOD shouts.html to 777.';
}
}
} else {
echo 'Could not locate file: shouts.html';
}
} else {
echo 'You must enter a message.';
}
} else {
echo 'You must enter your name.';
}
} else {
echo 'You must fill in both form fields.';
}
?>
And there you go.
Reply