SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot doca's Avatar
    Join Date
    Dec 2004
    Location
    Vienna, AT
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sajax_show_javascript

    hello
    i have small problem with this function
    why is msg row always empty ???
    I've tried everything, but nothing works please somebody help

    Code:
    id		id_user        allianz     	date       		msg
    Multihunter	0	      1     	 	135744706


    PHP Code:
    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);
        } 

    PHP Code:
    <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>

  2. #2
    SitePoint Zealot doca's Avatar
    Join Date
    Dec 2004
    Location
    Vienna, AT
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FIXED


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •