Note that there are some explanatory texts on larger screens.

plurals
  1. POthis is a chat box design displaying the sender and receiver messages
    primarykey
    data
    text
    <p>Basically, this code works but it displays both the sender and receiver in the same color what do i want? i want the sender colour to be different with the receiver message color</p> <p></p> <pre><code>&lt;?php require_once 'cn.php'; session_start(); // startsession .line17 (username || usernameto='.$username.') //messages sent or received by the $_SESSION or $_GET["ident"]..line 26 require_once 'protect.php'; $username=$_SESSION['UserID']; $fiveMinutesAgo = time() - 1000; $to=$_SESSION['UserTo']; $sql = 'SELECT username, message_content,message_file, message_time,usernameto FROM messages WHERE message_time &gt; ' . $fiveMinutesAgo . ' and ((username='.$username.' and usernameto='.$to.') or (usernameto='.$username.' and username='.$to.')) ORDER BY message_time'; $result = mysql_query($sql, $cn) or die(mysql_error($cn)); //mysql_query ("Update messages set message_file= replace(message_file,' ',''); while ($row = mysql_fetch_assoc($result)) { $hoursAndMinutes = date('g:ia', $row['message_time']); $mycontent=$row['message_content']; $myfile=$row['message_file']; $playfile="&lt;A href=upload/$myfile&gt; $myfile &lt;/A&gt;"; /*************************************************************************************************/ echo '&lt;i&gt;&lt;p style="font-family:arial;color:purple;font-size:15px;"&gt;&lt;strong&gt;' . $row['username']. '&lt;/strong&gt;: &lt;em&gt;(' . $hoursAndMinutes . ')&lt;/em&gt; ' . $playfile . $mycontent.'&lt;/i&gt;&lt;/p&gt;'; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload