DelphiDell
Erfahrenes Mitglied
Halo, ich stecke schon wieder in schwierigkeiten,
aber diesmal ist es wesentlich weniger Quelltex. Ich denke es liegt am AS.
Meine Flas Datei:
Meine PHP
Ich hoffe jemand kann mier helfen.
Gruss
DelphiDell
aber diesmal ist es wesentlich weniger Quelltex. Ich denke es liegt am AS.
Meine Flas Datei:
Code:
_global.chat = this;
var iv;
xm = new XML();
xm.load = function()
{
Update(this);
}
function Update(obj)
{
_root.log.htmlText = "//Chatlog V. 1.0 (c) Mario R.";
lv = new LoadVars();
lv.action = "load";
clearInterval();
lv.sendAndLoad("log.php",xm,"POST");
var mlis = xm.childNodes[0];
inslog(mlis);
setInterval(function() { Update(); }, 2000);
}
function inslog(node)
{
_root.log.htmlText = node.nodeName;
for(var i = 0;i<node.length;i++)
{
var nod = node.childNodes[i];
var from = nod.attributes.u_name;
var time = nod.attributes.time;
var msg = unescape(nod.attributes.msg);
writelog(from,time,msg);
}
}
function writelog(from,time,msg)
{
_root.log.htmlText = "Messages ausgabe 2";
_root.log.htmlText = '<font color="red">'+from+'</font>';
_root.log.htmlText = '<font color="green">['+time+']</font>';
_root.log.htmlText = '<font color="black">['+msg+']</font>';
}
Meine PHP
PHP:
<?php
if($_POST["action"] == "load")
{
$connect = mysql_connect("localhost","xxxxxxx","xxxxxxx");
mysql_select_db("xxxxxxxxxxx",$connect);
$q = mysql_query("SELECT * FROM chat_history");
echo '<messages />';
while($row = mysql_fetch_assoc($q))
{
echo '<log u_name="unknow" time="'.$row["time"].'" msg="'.$row["message"].'">';
}
echo '</messages>';
}
?>
Ich hoffe jemand kann mier helfen.
Gruss
DelphiDell