File size: 1.01Kb
<?php $action=$_GET["action"]; include "head.php";
if($_GET["action"]=="put") {
if($_POST["text"]==""){ echo '<center>Error, text left blank please go back and fix it.</center>'; include 'foot.php'; exit(); }
}
$_POST["text"] = str_replace($filter,"*",$_POST["text"]);
if($action=="put"){$get=file_get_contents('shout.dat'); $f=fopen("shout.dat","w+");
fwrite($f,'<center><b><a href="prof.php?user='.$_SESSION["userName"].'">'.$_SESSION["userName"].'</a></b><br>'.$_POST["text"].'</center>');
fwrite($f,"\r\n"); fclose($f); $old=file_get_contents("shouthistory.dat"); echo '<center>Shout added!</center>'; $x=@fopen('shouthistory.dat','w+'); @fwrite($x,$get); @fwrite($x,$old);
@fclose($x); }
if($action==""){ if(isset($_SESSION["userName"])){echo '<center><b>Shout</b></center><form action="shout.php?action=put" method="post"><center><input name="text" maxlength="100"/><br/><input type="submit" value="post"/></center></form>';}else{exit();}}
else if(isset($_GET["history"])){include 'shouthistory.dat'; } include "foot.php"; ?>