Skip to content

Instantly share code, notes, and snippets.

@leachim6
Created August 5, 2008 14:05
Show Gist options
  • Save leachim6/4071 to your computer and use it in GitHub Desktop.
Save leachim6/4071 to your computer and use it in GitHub Desktop.
<?php
$filename = "data.txt";
$whattoread = @fopen($filename, "r");
$file_cnt = fread($whattoread, filesize($filename));
$msg = "$file_cnt";
fclose($whattoread);
?>
<html>
<head>
<meta http-equiv="refresh" content="7">
</head>
<body bgcolor="#000000" text="#ffffff">
<div style="font-size:1000%; font-family:courier new; font-weight:bold;">
<?php echo $msg; ?>
</div>
</body>
</html>
<?php
if (isset($_POST['name']) && !empty($_POST['name'])) {
$nam = stripslashes($_POST['name']);
$msg = stripslashes($_POST["message"]);
$nam = htmlspecialchars($nam, ENT_QUOTES);
$msg = htmlspecialchars($msg, ENT_QUOTES);
$content = $nam . ": " . $msg;
//filtering
$blocked = array("fuck", "shit");
$replacewith = array("frak", "shazbot");
$content = str_replace($blocked, $replacewith, $content);
//write to file to display on wall
$filed = @fopen("data.txt", "w");
@fwrite($filed, "$content");
fclose($filed);
//write to log
$filed = @fopen("data.log", "a+");
@fwrite($filed, "$REMOTE_ADDR $content\n");
fclose($filed);
echo "<b>Message Posted $REMOTE_ADDR</b><br /><br />";
}
?>
<center>
<form name="Graffiti Wall" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="application/x-www-form-urlencoded">
Name: <br />
<input type="text" name="name" size="14"><br><br>
Message: <br />
<textarea rows="3" cols="15" name="message">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment