GET data and display ajax?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inny
    New Member
    • Nov 2007
    • 77

    GET data and display ajax?

    Is there any way to count users in my chatroom and display whos chatting using javascript or ajax? code in php below has issues, but this is what it should do.

    Code:
    <?php
    
    
    $chatnames = file('http://client11.addonchat.com/scwho.pl?id=292747&plain=1');
    $indx = count($chatnames);
    $indxcom = $indx - 1;
    if ($indx == 0) {
    echo "<b>No one is in the chat room at the moment</b>";
    }
    else{
    echo "<b>People Chatting:</b>&nbsp;&nbsp;";
     for($i = 0; $i < $indx; $i++) {
     $name = explode('	', $chatnames[$i], 2);
    echo " $name[0]";
     if ($i < $indxcom) {
        echo ", ";
    }  
    
      }
    }
    
    ?>
  • pronerd
    Recognized Expert Contributor
    • Nov 2006
    • 392

    #2
    I do not think so. JavaScript is a client side language. To do those things you would need to execute code on the server. So you would need a server side language like JSP, PHP, ASP, etc.

    Comment

    Working...