hello
i have small problem with this function
why is msg row always empty ???
I’ve tried everything, but nothing works please somebody help
id id_user allianz date msg
Multihunter 0 1 135744706
function add_data($data) {
global $session,$database;
$data = explode("|",$data);
$name = $session->username;
$msg = htmlspecialchars($data[1]);
$id_user = $session->uid;
$alliance = $session->alliance;
$now = time();
$q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ('$id_user','$name','$alliance','$now','$msg')";
mysql_query($q, $database->connection);
}
<script type="text/javascript">
<?php sajax_show_javascript();?>
function show_data_cb(text) { document.getElementById("masnun").innerHTML = text; }
function start_it() { x_get_data(show_data_cb); setTimeout("start_it()",1000); }
function add_cb() {}
function send_data() {
msg = document.form1.msg.value;
x_add_data(name +"|"+msg,add_cb);
}
</script>