Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
My friend asked me to add some smilies in his comment box and well for some reason everything coming out in text and not in smilies i am not getting any errors but can someone help me pleaseCode: Select all
<?php
include 'db.php';
$comment = mysql_query("SELECT * FROM comment WHERE filter = 'pic1' ORDER BY date DESC");
while ($row = mysql_fetch_array($comment)) {
$username = $row['username'];
$message = $row['message'];
echo "<font color='FF9AFF'><center><b>$username</b>: $message</font></center><br>";
}
if ( isset ( $_POST['message'] ) )
{
$name = addslashes($_POST['username']);
$message = $_POST['message'];
if ( ( isset($username) ) && ( isset($message) ) )
{
// getting smilie list
$smilies = mysql_query("SELECT * FROM smilies") or die(mysql_error());
while($get = mysql_fetch_array ($smilies))
{
$alt = $get['Alt'];
$smilie = $get['URL'];
$message = str_replace( $get['Symbol'] , '<img src="smilies/'.$smilie.'" border="0" width="15" height="15" alt="'.$alt.'">' , $message);
$themessage = addslashes($message);
// replacing all smilies
}
}
}
?>
<center><form action="insert.php" METHOD="post">
<br><br><br><font color="FF9AFF">Name:</font><br>
<input type="input" name="username" size="30" value="" class="input-box"><br>
<font color="FF9AFF">Message:</font><br>
<input type="input" name="message" size="30" value="" class="input-box"><br>
<input name="filter" type="hidden" value="pic1">
<p><input type="submit" name="submit" value="Submit">
</form>
</center>Thank you
Smackie
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]