473,795 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GET data and display ajax?

77 New Member
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.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.  
  4.  
  5. $chatnames = file('http://client11.addonchat.com/scwho.pl?id=292747&plain=1');
  6. $indx = count($chatnames);
  7. $indxcom = $indx - 1;
  8. if ($indx == 0) {
  9. echo "<b>No one is in the chat room at the moment</b>";
  10. }
  11. else{
  12. echo "<b>People Chatting:</b>&nbsp;&nbsp;";
  13.  for($i = 0; $i < $indx; $i++) {
  14.  $name = explode('    ', $chatnames[$i], 2);
  15. echo " $name[0]";
  16.  if ($i < $indxcom) {
  17.     echo ", ";
  18. }  
  19.  
  20.   }
  21. }
  22.  
  23. ?>
  24.  
Mar 13 '08 #1
1 1146
pronerd
392 Recognized Expert Contributor
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.
Mar 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2056
by: christopher.secord | last post by:
I would like have a little "loading..." tab not unlike the one that gmail uses and I would like to display that tab while an ajax call is made. The javascript to display the tab works. The javascript to hide the tab works. But when I put the two together inside the function that calls the ajax service, they don't work. What seems to happen is that calls to change DOM object properties are queued up, and then all executed...
3
1521
by: Mazin07 | last post by:
I have a script that makes multiple requests to several sites. However, each request takes a little while. How can I get the PHP script to output data to let the user know that it's checking? For example, I have echo "Checking..."; at the beginning, before I do any hocus-pocus, but it doesn't show up until the script is done. How do I get it to send some data at a time?
8
1906
by: lli | last post by:
Hi Guys, I have designed a web application. In its one window I put a form. User can click submit button of this form to run a pathon script to get data from database. Then User get a new window which display the result. Now I want to put the form and display data on the same window. How I can do this? If I use frameset, I need to put form in a html file and put data in a table in scond html file. How I can do this?
5
2443
by: ggk517 | last post by:
We are trying to develop an Engineering application using PHP, Javascript with Informix as the back-end. Is it possible to retrieve data using Javascript but by accessing the Database. Say somebody enters part_no, than using Javascript is it possible to connect to the part master and retrieve the division and desc information? I am not allowed to use the PHP because this will require the user to insert the part number on the first...
3
3300
by: SimonPlatten | last post by:
Hi, I'm a software engineer working in the offshore industry, I've been coding in various languages professionally since 1987. In my present employment I am working with control systems in the oil and gas industry. Typically control systems use process control or scada systems to display and log data from various control environments. I am designing an Intranet using AJAX to acquire data from remote servers and present dynamic updates...
1
1458
by: 2291980 | last post by:
Hello I have create one page where on perticuler click i am calling 6 js function one after another. this all function are ajax function every thing is working fine . But issue is that it takes lots of time to display data. It takes almost 1 to 1.5 min to display data. can any body help me on that.....
14
23171
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
2
1717
by: Lupus | last post by:
Hi, I've written a function in javascript to obtain content using AJAX. While AJAX is loading, I want to show a div which says "please wait while loading. This is a part of the function: z.style.display = "none"; y.style.display = "block"; ajax = new AjaxHandler;
4
1220
by: JJ | last post by:
I want to be able to display items and their categories on a page, so that the user can click on an item to edit it, or add further items or categories. Simple enough, however, I want to do it on a AJAX page (i.e. without postbacks). Which control or approach should I use to display the heirachical data? I understand that I cannot use Treeview? Does anyone know if this is correct? Any other approaches?
2
2261
by: malcster2 | last post by:
hello, i am a beginner to ajax. i have created a mysql database, which i would like to access from a web page. i have created 3 files, a html to display the data, a php file to extract the data, and a javascript file to to the clever stuff. when i access the html page, all the data is displayed correcty, but if i add or delete any records, and press the button i have created to refresh the data(without reloading), the data doesn't change....
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.