Jump to content

Need help functions


dynamicgfx

Recommended Posts

Need help with the code below it gives a fatal error

 

<? $result = mysql_query("SELECT * FROM topics WHERE id='$id'");

while($row = mysql_fetch_array($result))
  { 
  $des = $row['desc'];
		?>
            <?
		function replacesmiley($des)
{
         $des = str_replace('', '<img src="set1/biggrin.gif" alt="" />', $des);
         $des = str_replace('', '<img src="set1/biggrin.gif" alt="" />', $des);
         $des = str_replace('', '<img src="set1/sad.gif" alt="" />', $des);
	 $des = str_replace('', '<img src="set1/001_smile.gif" alt="" />', $des);
         $des = str_replace('', '<img src="set1/tongue_smilie.gif" alt="" />', $des);
         $des = str_replace('', '<img src="set1/tongue_smilie.gif" alt="" />', $des);
         return $des;
} ?>
<table width="100%" border="1" cellpadding="0" cellspacing="0" style="border:thin; border-top:none;">
  <tr style="color:#FFF;">
    <th width="30%" bgcolor="#000000" scope="col"></th>
    <th width="70%" bgcolor="#000000" scope="col"><? echo $row['name']; ?></th>
  </tr>
    <tr height="50px" style="text-align:center; background:url(http://k-rs.co.uk/images/background.png);">
    <td><? echo $row['user']; ?><br /><? echo $row['post']; ?></td>
    <td><? echo replacesmiley($des) ?></td>
  </tr>
  <? $server = mysql_query("SELECT * FROM reply WHERE topic='$id'");

while($rows = mysql_fetch_array($server)) { 
$user = $rows['user'];
$desc = $rows['desc']; ?>
            <?
		function replace($desc)
{
         $desc = str_replace('', '<img src="set1/biggrin.gif" alt="" />', $desc);
         $desc = str_replace('', '<img src="set1/sad.gif" alt="" />', $desc);
	 $desc = str_replace('', '<img src="set1/001_smile.gif" alt="" />', $desc);
         $desc = str_replace('', '<img src="set1/tongue_smilie.gif" alt="" />', $desc);
         return $desc;
} ?>
  </tr>
    <tr height="50px" style="text-align:center; background:url(http://k-rs.co.uk/images/background.png);">
    <td><? echo $rows['user']; ?><br /><? echo $rows['rank']; ?><br />Posted at: <? echo $rows['post']; ?></td>
    <td><? echo replace($desc) ?></td>
  </tr>
<? }} ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.