This wasn't really a reply to me but.... On Mon, 28 Jun 2004 09:20:14 -0700 (PDT), Matthew Sims <[EMAIL PROTECTED]> wrote: > > > On Fri, 25 Jun 2004 09:07:16 -0500, Stephen Craton > > <[EMAIL PROTECTED]> wrote: > >> > >> What I'm basically trying to do is make the database display out the > >> information from it's tables as soon as it possibly can without the need > >> for > >> refreshing. For example: > >> > >> Someone enters in some text, and it's put into the database. As soon as > >> possible, the text is shown in a page that wasn't refreshed and has been > >> shown at all times, on several computers. They don't all have to be > >> synchronized, just that it shows as soon as it possibly can without > >> refreshing. > >> > >> This may be an HTTP push method, the name sounds similar to what I'm > >> trying > >> to do. What exactly is it and how do you utilize it? > > > > Let me say this very clearly. Getting the data to the user *as soon > > as* it's entered into the DB is impossible unless you: > > > > 1) Have a PHP script which never ends and is constantly asking the DB > > for more data (this is very server resource intensive and it a *bad > > idea*) > > 2) Write a client program that does *not* rely on the web browser. You > > can use Java to make it load in the browser, but then it wouldn't be > > PHP. > > > > IMHO, your *only* bet to do this elegantly *with* PHP is to use some > > JS. Have a hidden iframe that the JS reloads every x seconds. The JS > > reads the data in the iframe and outputs new data to the user's > > screen. The user's page itself will never refresh. > > > > As far as I know, you can't stream data into a database. It takes it all > in with the INSERT command (or whatever database you use). For security > reasons, streaming data into a database would be bad. You better check all > those statements before they're entered into the database or else risk > having the DB/server taken hostage or corrupted.
I wasn't talking about streaming inserts, I was talking about real-time updated messages. An INSERT would require a GET or POST request, of course. This could also be done in a iframe by JS, though. > > Any activity taken on the client's browser without a refresh would require > a language such as Javascript. But Javascript is CSI and won't insert data > into your database. You need an SSI like PHP do to that. JS can't insert data, but it can use an iframe to post data if you want it to. > > The PUSH thing you're referring to? Are you talking about the PSH flag in > TCP? PUSH is a transport-layer protocal. HTTP only has GET and POST (as > well as OPTION,HEAD,PUT,DELETE,TRACE and CONNECT) which are > application-layered. I didn't refer to anything. Others did. You can't PUSH from the server with HTTP it just doesn't work. The person asking about this needs to sit down and look at how client/server works. To make this work as a chat client, you have to poll or use sockets. -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php