-
Notifications
You must be signed in to change notification settings - Fork 3
/
chatview.php
29 lines (29 loc) · 840 Bytes
/
chatview.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<script type="text/javascript">
function scrollBottom()
{
var objControl=document.forms["FrmTestScroll"].elements["chat"];
objControl.scrollTop = objControl.scrollHeight;
}
</script>
</head>
<body onLoad="scrollBottom()">
<?php
include("dbconnection.php");
$result = mysql_query("SELECT * FROM chat");
echo "<form method='post' action='' name='FrmTestScroll' id='FrmTestScroll'>
<textarea name='chat' cols='45' rows='20'>";
while($rowa = mysql_fetch_array($result))
{
$resulta = mysql_query("SELECT * FROM employees where empid='$rowa[senderid]'");
$rowaa = mysql_fetch_array($resulta);
$names = $rowaa['fname'] ." ". $rowaa['lname'];
echo $names . " : " . $rowa['message']. "\n";
echo "_____________________________________________\n";
}
echo "</textarea>";
echo "</form>";
?>
</body>
</html>