After this....
<?php
if (isset($_POST['text'])) {
///////////////////////////////////////
// Clean the text from HTML, PHP, and Cussing
$text = strip_tags(trim($_POST['text']));
$badwords = array("sucks", "damn", "#!@?", "ASP");
$text = str_replace($badwords, "****", "$text");
?>add the following....
<?php
// put the smile keys(the symbols people type for smileys)into an array
$smilekey = array(":)", ":P", ";)");
/*
put the url's of your smile images and html format to display them into
an array, making sure they are in the same sequence as the smile keys.
Change the url to wherever you have your images stored.
*/
$smilereplacement = array("<img src=images/smiley.gif>",
"<img src=images/tongue.gif>", "<img src=images/wink.gif>");
// replace the symbols in the message with the html & urls
$text = str_replace($smilekey, $smilereplacement, $text);
// end of added code
?>