ok i cant seem to get the guestbook to process the smileys before it adds it into a database, below is how i call the smiley_face function
add_post.php
include ("guestbook_functions.php");
//smileys variable in config file turned to 1 which equals on
if ($smileys == 1)
{
$guest_comments = smiley_face($guest_comments);
}
guestbook_functions.php
function smiley_face($message)
{
$sm1 = array( ":?:", ":D", ":?", "8)", ":cry:", ":shock:", ":evil:", ":!:", ":frown:", ":idea:", ":arrow:", ":lol:", ":x", ":mrgreen:", ":|", ":P", ":oops:", ":roll:", ":(", ":)", ":o", ":twisted:", ":wink:" );
$sm2 = array( "question", "biggrin", "confused", "cool", "cry", "eek", "evil", "exclaim", "frown", "idea", "arrow", "lol", "mad", "mrgreen", "neutral", "razz", "redface", "rolleyes", "sad", "smile", "surprised", "twisted", "wink" );
$sm3 = array( ":?:", ":D", ":?", "8)", ":cry:", ":shock:", ":evil:", ":!:", ":frown:", ":idea:", ":arrow:", ":lol:", ":x", ":mrgreen:", ":|", ":P", ": oops :", ":roll:", ":(", ":)", ":o", ":twisted:", ":wink:" );
// Inserting smiley faces for guestbook users
for ($i=0; $i<=22; $i++)
{
$message = str_replace($sm1[$i], "<img src=\\"../images/smileys/icon_$sm2[$i].gif\\" ALT=\\"$sm3[$i]\\">", $message);
}
return $message;
}
it just outputs the smiley that i enter into the database instead of the image link, any help would be much appreciated thanks