<html>
<head><title>hell0 it</title></head>
<body>
<pre>
<a href="index.html">h o m e</a>
</pre>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST">
<textarea name="message" rows="20" cols="60" wrap="virtual"></textarea>
ascii art? <input type="checkbox" name="ascii" />
<br><input type="submit" value="hell0 it" />
</form>
<br>
<?php
/*********************************************************************************************************
Sh0ut/hell0 it! is a simple message posting script written in PHP that does not requires only a text file
Copyright (C) 2004 Alex Beal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*********************************************************************************************************/
if(@$raw_message=rtrim(strip_tags($_POST['message']))) //check for string in shout
{
/*FORMATTING STRING*/
if(strlen($raw_message)>2000) //if over 2000 characters truncate and format
{
$fmessage = "\n<hr> " . substr($raw_message,0,2000) . '<p>Message truncated to 2000 characters' . '<!--' . $_SERVER['REMOTE_ADDR'] . '-->';
} else { //if under 2000 characters just format
$fmessage = "\n<hr> " . $raw_message . "<!--" . $_SERVER['REMOTE_ADDR'] . "-->";
}
if(@$_POST['ascii']) //if ascii art then insert <pre> tags into $fmessage
{
$fmessage = substr_replace($fmessage,'<pre>',0,0) .'</pre>';
}
/*WRITING STRING TO DATABASE FILE*/
umask(077); //make the file 077 permission
$messagedb=fopen("shout", "r+");
flock($messagedb,2); //stop file from being messed up
$old_data = fread($messagedb, filesize("shout")); //get all stuff from the file (old data)
rewind($messagedb); //to to beginning
fwrite($messagedb,"$fmessage". "$old_data"); //write new stuff then add old data
flock($messagedb,3); //perissions back
fclose($messagedb); //close file
}
/*DISPLAY MESSAGE DATABASE*/
echo '<tt>'; //needed to format ascii art corretly
include "shout";
echo '</tt>';
?>
<p><b><font size="-3">Sh0ut/hell0 it! V2.3.1</b> Alex Beal (C) 2004. Released under the <a
href="[PLAIN]http://www.gnu.org/copyleft/gpl.html">GNU[/PLAIN] GPL</a>.</font>
</body>
</html>