Welcome Guest ( Log In | Register )

Hak5 Graffiti Wall, Lets make the code even better
Darren Kitchen
post Mon, 04 Aug 2008 23:41:38 +0000
Post #1


Hak.5 Junkie
************

Group: Root Admin
Posts: 3,127
Joined: Tue, 26 Jul 2005 15:52:42 +0000
From: Williamsburg, VA
Member No.: 2



Hey guys, this is the code I whipped together to make the Hak5 Graffiti wall. Toss in a projector and a webcam and it's fun for the whole Internet. Now lets make it even better! smile.gif

Write.php

CODE
<?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"></textarea> <br /><br />

<input type="submit" value="Write on the Hak5 Wall" name="submit">
</form></center>



show.php
CODE
<?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>


Suggestions?


--------------------
Go to the top of the page
 
+Quote Post

Posts in this topic
- Darren Kitchen   Hak5 Graffiti Wall   Mon, 04 Aug 2008 23:41:38 +0000
- - RogueHart   i already suggested a username and account thing. ...   Mon, 04 Aug 2008 23:46:34 +0000
- - Pizza   i have error with "<?php echo $_SERV...   Tue, 05 Aug 2008 00:11:50 +0000
- - Tenzer   I would suggest that you base this on a database i...   Tue, 05 Aug 2008 01:01:59 +0000
|- - RogueHart   QUOTE (Tenzer @ Tue, 05 Aug 2008 02:01...   Tue, 05 Aug 2008 10:39:59 +0000
- - iisonly   tried to something similar It would display inser...   Tue, 05 Aug 2008 07:50:04 +0000
- - crazyren   lil' update...to write.php * Smileys * BBC...   Tue, 05 Aug 2008 09:20:56 +0000
- - Rab   Darren you may steal a copy of my accessible Ajax/...   Tue, 05 Aug 2008 12:25:05 +0000
- - Strife25   It would be cool to integrate this hack with the E...   Tue, 05 Aug 2008 17:16:39 +0000
- - RogueHart   i would love to see what someone breaking into you...   Tue, 05 Aug 2008 18:08:06 +0000
- - Fruitpastles   You could use str_ireplace(). It's the same bu...   Tue, 05 Aug 2008 19:34:02 +0000
- - darthneo   Might i suggest this for the name input tag in wri...   Tue, 05 Aug 2008 19:48:23 +0000
- - RogueHart   the "please wait" thing when your the la...   Tue, 05 Aug 2008 19:51:57 +0000
- - acer5050   Great ideas guys! I love this thing...   Tue, 05 Aug 2008 20:36:53 +0000
- - RogueHart   edit. nvm. fixed   Tue, 05 Aug 2008 23:29:30 +0000
- - Fruitpastles   Here's a few functions I threw together that m...   Wed, 06 Aug 2008 10:34:20 +0000
|- - natural_orange   I Think it would be better if it just showed the l...   Wed, 06 Aug 2008 22:33:12 +0000
- - Darren Kitchen   RE: Hak5 Graffiti Wall   Thu, 07 Aug 2008 01:19:22 +0000
|- - Tenzer   QUOTE (Darren Kitchen @ Thu, 07 Aug 2008 08...   Thu, 07 Aug 2008 01:38:39 +0000
- - digip   Is there going to be an offline archive of the wal...   Thu, 07 Aug 2008 02:00:09 +0000
- - Mnemonic   Hey Darren why not a project similar this in the f...   Wed, 13 Aug 2008 05:50:10 +0000
- - Conor_M   Yeah, I suggested that to Matt the other night..   Wed, 13 Aug 2008 20:46:31 +0000
- - IceCold   QUOTE (digip @ Thu, 07 Aug 2008 09:00...   Fri, 15 Aug 2008 07:12:49 +0000
- - UberTaco   Hey guys, I'm lovin' the graffiti wall (ev...   Fri, 15 Aug 2008 09:04:16 +0000
- - UberTaco   And a pair of bash functions for dropping in your ...   Fri, 15 Aug 2008 09:41:01 +0000
- - VictorOfSweden   Here's my MySQL version of the Hak5 Graffiti W...   Fri, 15 Aug 2008 19:47:06 +0000


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: Thu, 02 Sep 2010 09:47:28 +0000