Og her er index.php
----------------------------
<?
include ( "../chat/config.php" );
unset( $user_name );
session_start();
if ( !isset($user_name) || $user_name=="" ) Header ( "Location: index.php?goPage=chatlogin" );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>chatten</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ***********************************************************************
OleBole-Chat Version 1.0
(c) Copyright Ole Clausen, 2003
This chat was downloaded from
http://www.eksperten.dk/spm/ The code is free to use if you leave these lines untouched.
If you alter the code, dont erase these lines.
Add a modification-notice instead.
************************************************************************ -->
<style type="text/css">
td {
font-family: verdana, arial, sans-serif;
font-size: 11px;
}
.msgTbl {
width: 100%;
}
td, input, button {
font-family: verdana, arial, sans-serif;
font-size: 11px;
}
input {
width: 100%;
border: 1px dashed #336699;
}
button {
background-color: #dedede;
border: 1px solid #336699;
margin-left: 15px;
}
.u {
width: 100px;
color: #ff0000;
vertical-align: top;
padding: 5px 12px 5px 5px;
border-bottom: 1px dashed #999999;
}
.m {
padding: 5px;
border-bottom: 1px dashed #999999;
}
.time {
color: #336699;
font-size: 9px;
}
.clHidFrame {
position: absolute;
width: 1px;
height: 1px;
left: 0px;
top: 0px;
}
#chat {
width: 450px;
}
</style>
<script type="text/JavaScript">
var maxNumMsgs = <?=$maxNumMsgs?>;
var hiCol = "<?=$hiCol?>";
var loCol = "<?=$loCol?>";
var d=document;
function gE(id){return d.getElementById(id)}
function gA(o,tN){return o.getElementsByTagName(tN)}
function writeChat( a ) {
var tbl = gE("chat");
for (i=0; i<a.length; i+=3) {
var bgCol = ( gA(tbl, "TR")[0].style.backgroundColor=="#ffffff" )? loCol : hiCol;
var newRow = tbl.insertRow(0);
var newCell = newRow.insertCell(0);
newCell.innerHTML = "<b>" + a[i] + "</b><div class=\"time\">[" + a[i+1] + "]</div>";
newCell.className = "u";
var newCell = newRow.insertCell(1);
newCell.innerHTML = a[i+2];
newCell.className = "m";
newRow.style.backgroundColor = bgCol;
}
var numMsgs = gA(tbl, "TR").length;
while ( numMsgs>maxNumMsgs ) {
tbl.deleteRow(numMsgs-1);
numMsgs--;
}
}
window.onunload = function() {
window.open( "logout.php", "logOutWin", "width=100,height=100" );
}
</script>
</head>
<body>
<div style="width:470px">
<div id="bla" style="height:250px;overflow:auto;">
<table id="chat" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="2"> </td>
</tr>
</table>
</div>
<table class="msgTbl" cellspacing="0" cellpadding="0" border="0">
<tr>
<form name="msgForm" target="msgFrame" action="msg.php" method="post">
<td>
<input type="text" name="msg">
</td>
<td style="width:10px;"><button type="submit">Send</button></td>
</form>
<form name="logoutForm" action="../index.php?goPage=start" method="post">
<td style="width:10px;"><button type="submit">Logout</button></td>
</form>
</tr>
</table>
</div>
<iframe name="msgFrame" class="clHidFrame" src="msg.php" frameborder="0"></iframe>
<iframe name="chatFrame" class="clHidFrame" src="chat.php" frameborder="0"></iframe>
</body>
</html>