Jump to content

problem with avatar in chat windo


pwesthead

Recommended Posts

Hi i have a chat written in php and as3

at the moment the chat window shows username and message but i want to add a avatar before the username.

here is the code i have.

 

 

$sql = mysql_query("SELECT * FROM chat75 ORDER BY date_time ASC");

    while($row = mysql_fetch_array($sql)) {

      $id = $row["id"];

      $user_name = $row["user_name"];

      $chat_body = $row["chat_body"];

      $num = $row["avatar"];

      $date_time = $row["date_time"];

      $chat_body = stripslashes($chat_body);

        $chat_body = eregi_replace("'", "'", $chat_body);

      $string =array();

$files = glob("../images/avs/*.*");

for ($i=1; $i<count($files); $i++)

{

  $num = $files[$i];

 

  }

        $body .= '<b><font color="#006699">' . $num . ': ' . $user_name . ':

     

      <font color="#000000"> ' . $chat_body . '</font>

        <br />';

 

    }

 

this is what i get in the chat window

 

../images/avs/avatar9.png: demo123: testing message

 

i have tried everything to get the avatar to appear in the chat window but keep getting the above,i have tried to put echo in front but then just get a blank chat window.

please help

thanks

Link to comment
https://forums.phpfreaks.com/topic/262498-problem-with-avatar-in-chat-windo/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.