Real-time Chat


Dec 11, 2007

I wrote a PHP chat system similar to gChat which simply uses constant ajax calls to update the chat. This system is fine for a few users, but with potentially thousands of users, it is much too hard on the server. I've been considering taking the 'Comet' route, but have heard that PHP can't handle Comet very well. What would be the best language/API to perform real-time chat for a large user-base?

View 3 Replies


ADVERTISEMENT

Implementing Real Time Chat Using A Backend?

I was thinking of implementing real time chat using a PHP backend, but I ran across this comment on a site discussing comet:

My understanding is that PHP is a terrible language for Comet, because Comet requires you to keep a persistent connection open to eac browser client. Using mod_php this means tying up an Apache child full-time for each client which doesn’t scale at all. The people know doing Comet stuff are mostly using Twisted Python which is designed to handle hundreds or thousands of simultaneous connections.

View 10 Replies

Real Time Chat With Ajax Polling?

I need to create a chat similar to facebook chat. I am thinking to use ajax polling ( to send request every 2-3 seconds ). Is this a good approach ? Or I need to use other server side languages like erlang and server-comet ?

View 2 Replies

Homework - Write A Real Time Chat Using XAJAX?

How can I write a real time chat using XAJAX and PHP?

In other words, is there a way to send xajax responses from the server to multiple clients? Or is the only possibility to check for new messages every few seconds on client side?

View 4 Replies

Real Time Reporting - Display The Most Recent Entry On A Web Page In Real Time

If I have entries in a mysql db and I want to display the most recent entry on a web page in real time, how would I go about this? Would I have to write a script that queries the database every couple of seconds? Or is there a way to get the database to communicate with a script so that it only gets queried when there is a new entry?

I am just thinking about the best way of not overusing the server by checking every 1-2 seconds. Something a bit like a forum "users currently online are: etc.." but up to date within a few seconds.

View 4 Replies

Getting User's Current Time (not Server Or Computer Clock BUT ACTUAL Real Time) And Pass As A Variable Into It

EDIT: I'm not sure if this would work but sometimes you get those annoying pop-ups that tell you what city/suburb you're in (usually for dating sites) - could we somehow extrapolate from that data what the time is? Is this data based on a reverse IP lookup??

View 3 Replies

Javascript Real - Time Countdown (count From Start To End Time)

I do have the countdown script (see link below) to display the time between current time and the date given in real-time. However, I want to achieve to display the time difference between a given start and end time. Right now, it calculates from the current server time to the end time. I want to be able to set up my own start time and end time. Here is what I have: [URL]

View 1 Replies

Real Time (or Live Time) Clock Only With Pure Script?

Is the real time clock possible only with pure PHP rather than PHP and Javascript combination? When I say real time clock I mean the clock goes by every single second (12:23:32).

View 1 Replies

Unix Time To Real Time

Not sure whats up with the code

$date = strtotime("%b %d, %Y", $datedata);
$time = strtotime("%I:%M:%S %p", $datedata);

The time i gets from the DB is 1298747601 and is the $datedata I have date_default_timezone_set('America/Los_Angeles'); at the top of the script.

View 2 Replies

Real-time Output?

I'm a relative PHP newbie, so I apologize if this is a simple question.

Anyway, here's my problem. I'm using a PHP script to pre-render a bunchload of insert files for an HTML page. Right now there's about 1,600, but that number could get much, much higher when the site goes live.

I'll only need to re-render the whole batch once or twice a year (if that) but it's still something I'd like to be able to do in case I have to move the site to a different server, or there's a hard drive crash or etc.

Basically what the script does is grab a whole bunch of information from a database and write the insert file. It does this for every single one.

The problem of course, is that PHP by default does all this server-side, and then sends it to the browser. Because this process takes like ten or twenty minutes to do, the browser times out long before it's finished.

Is there a way to get progressive output with PHP? Or do I need to re-do this in another language like Perl?

View 9 Replies

Real-time Clock

Where should I start to write a Real-time Clock? I want it be dynamic, not static. I know how to get the time and display it but how do I keep changing it ?

View 1 Replies

Date In Real Time

It is possible to create a program which get the date in real time using PHP.

View 3 Replies

Real Time Sql Query

I am making a web-based chat but to get the msg from the database i need to refresh the page and that will make load and extra bandwidth on the server so i want to make the query in real time ( only the new msg to be received without refresh the whole page ), Any one in here knows how to get data from sql database without having to refresh page.

View 3 Replies

Displaying Real Time?

I am currently displaying date/time on my webpage using the date function PHP provides. However, using this function, the date/time will only be updated when reloading the page. I have the date/time updated every second instead.

View 6 Replies

Run Process In Real Time?

I'm trying to figure out how to display output (and read input) in real time in a process launched by PHP on the command line. There seem to be many alternatives: shell(), exec(), system(), popen(), proc_open()

and it is not completely clear to me what are the differences. All I need is to execute a process, display its output on the same terminal where the PHP script is invoked, maybe read input and finally return to the PHP script flow when the process exits. Among the options I listed proc_open() is probably able to do this, but it seems overkill, as all I want to do is to give control to an external process and wait for it to finish.

There are some questions which seem related, but as far as I can see they are actually about sending the process in background (which I do not want) or displaying the output in a browser (which is not my case, everything is in a terminal).

View 2 Replies

Real Time Echo'ing Of Var In A Loop

i have a big loop, and rather then waiting until its done for me too see what happened, every time it runs, how can i get the browser to echo the result, and proceed to keep running the loop.

basically this loop takes a long time to finish, and i had to set my max runtime past 30 seconds. i guess incorporating a refresh of some sort like this would eliminate the need for the time extension too?

View 6 Replies

Real Time Form Update

i have a script that i wrote for my clan/guild/linkshell in this online game i play that keeps track of members, the points they receive from events, items etc. in the admin panel of the script where you can update peoples points i want to know if i can add a button or something similar that if you push it updates the points which is currently in another text box in the same form in real time.

I'm sorry if i'm not being clear, what i'm trying to do it make it quicker to update a members points because usually after each event they receive either 10 or 20 so i want to add a button where if you push it then it will put 10 or 20 in the 'add' box in real time. right now when you edit a member it shows their current points in a text box and under that two text boxes, one if you want to add points and another if you want to subtract points.

if this isnt possible then i assume that i'd have to make it update the points in the box and keep all the values from before and just reload the page with the new value inside the box. wow, i'm sorry if i'm not very clear, please ask questions if you dont understand what i'm trying to say.

View 4 Replies

Real-time Action Ala Games??

What would be a proper solution for automated decision making in a PHP script, like a game? That is, without an external application, or any human input. For example, any random event that happens when the player is away from the game. How would one go about implementing that?

View 6 Replies

Real Time Listbox Update

I have one listbox that I populate with

while($row = mysql_fetch_array($result, MYSQL_ASSOC)

I need to in real time populate another listbox from a related table based on what they have currently selected in the first listbox. Is this possible with php and if so.

View 5 Replies

Real-time File Uploading Through FTP?

Is it possible to upload a file to the FTP server using PHP script while the same script is downloading the meant file from somewhere else? So at the time script is downloading it should upload the file in real-time.

View 3 Replies

Wordpress - DATETIME To Real Time?

Getting the time from a Wordpress post (the field being post_date_gmt stored in DATETIME), how can I convert that information (e.g 2011-03-23 20:28:26) to an actual, maleable date in PHP? (like Thursday, March 23rd, 2011)

View 3 Replies

Real Time RSS Display On Web Page?

i have a php script who parser a rss and give me the data in a know pattern. Im very new with ASP, JavaScript and Jquery. how to autoupdate the script and display the new data with a smooth animation (see this example, that exactly what i want).

View 3 Replies

Make For Loop Real Time?

I want to Make a Script which give result realtime. In My Script it have 3 steps. 1st step was to grab all links from a webpage .(i use pregmatch_all function coz all links i need are started with same domain [URL]... and grab from [URL]... ) 2nd step i have to grab direct link from all links (like [URL]...) 3rd step Upload that file to and third party site and get the upload link from there . lastly i added a function named which get the page ranges (like '1|5' ) so script upload all links from [URL]... I have done the scipt it was alo running ok but it shows result after all completed but i want a realtime result like script have grabed one link and do all steps with it and show that reult link on browser and then so on i mean a realtime solution. How can i do that i used for loop but no real time result.

View 3 Replies

Storing Real Time Data?

I am building a website in which the user can select what list items they see in their navigation menu, my idea is to store the menu items that the user selects in a cookie as this will stop the need for the user to be registered member on the website, is it possible to store realtime data in a cookie and how would I do this? For more information the navigation options are built from a mysql result, the then clicks a link and that link is added to a different list, if they click it again it is deleted, I need to add/remove these items from the cookie as the user add/removes it from there list.

View 2 Replies

Generating Link ID's In Real - Time

This question evolves around the concept of how we can add <a name="id here"></a>'s on a web page to allow a visitor to skip to sections of the page without having to scroll down a lot. I'm thinking about how I could achieve this in PHP. A web page would have various <a name="id here"></a> scattered throughout its length (the longer the page the more there would be) and PHP would simply go from top to bottom and add a numeric value for each one.

Any ideas how you would tackle this one? The ID's could be 0, 1, 2, 3 etc. so the $i = $i++ is fine but it's getting that to paste itself automatically inside of each <a name="id here">. I guess I could just put $i = $i++ after each section then <a name="$i"> however somehow I'm not convinced that's the professional way to go about it.

I'm thinking along the lines of having a function which spits out an ID then preserving the value for the next time it's called, in which case it will simply +1 to the preserved value. The preserved value then is deleted once the function is called the last time on that page so if the page is refreshed it would start from 0 or 1 again. As it's only going to be a few lines of code I don't think there's any concern for server CPU time in this case given it will generate the ID's on each page refresh.

View 8 Replies

Program A Collaborative Real-time Web App?

I was wondering if anyone had any good starting points for making a web based app that had Collaborative real-time editing.

The best way I can think of would be to write it with php, mysql and ajax. Where if you edit a block of information in a textbox form, I would then use javascript onBlur or onChange to send an ajax request that then sends a request to a php page that processes the new data and inserts it into mysql.

But how do I get the new information to update on someone else's browser? I could use javascript set_interval to reupdate the textbox every couple of seconds, but that sounds kind of wasteful?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved