473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Server push using PHP ?

Is it possible to "push" data from a server to a client, using PHP
server side scripting?. An example script will be very useful.

Thanks

Dec 21 '05 #1
4 16311
Please explain in greater detail, with an example explanation of what
you want to do.

Dec 21 '05 #2
The HTTP protocol works on the request-response principle which means
that the server can only generate a response following a request from
the client. This means that the server *cannot* send a response to the
client without having received a request in the first place. This is
not a PHP issue, it is an HTTP issue.

Dec 21 '05 #3
"Susan Baker" <sb****@no.spam.net> wrote ...
Is it possible to "push" data from a server to a client, using PHP server
side scripting?. An example script will be very useful.


If I understand you correctly you need a type of server app that a chat or
messaging client can connect to on a specific port, and once the connection
is established your server needs to be able to pump data down the pipe
without client requests (ie. passive client). Usually these kind of apps are
separate processes that run continuously on a web server, often written in
Java, Python etc. PHP scripts normally run once upon request, output
something and exit. But you could write a PHP script that executes
continually in an endless loop and have it act as a socket server, as
demonstrated in this tutorial:
http://www.zend.com/pecl/tutorials/sockets.php This is more of a hack than a
solution though.

The client can't be a regular web browser as it can only receive data on
request, but you can use the Flash player, because it has an XML socket API.

..soma
Dec 21 '05 #4


somaboy mx wrote:
"Susan Baker" <sb****@no.spam.net> wrote ...
Is it possible to "push" data from a server to a client, using PHP server
side scripting?. An example script will be very useful.

If I understand you correctly you need a type of server app that a chat or
messaging client can connect to on a specific port, and once the connection
is established your server needs to be able to pump data down the pipe
without client requests (ie. passive client). Usually these kind of apps are
separate processes that run continuously on a web server, often written in
Java, Python etc. PHP scripts normally run once upon request, output
something and exit. But you could write a PHP script that executes
continually in an endless loop and have it act as a socket server, as
demonstrated in this tutorial:
http://www.zend.com/pecl/tutorials/sockets.php This is more of a hack than a
solution though.

The client can't be a regular web browser as it can only receive data on
request, but you can use the Flash player, because it has an XML socket API.

.soma


Tks. Looks like what I'm looking for

Dec 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Bradbury | last post by:
I want to send updates from a long running cgi. I have tried copying perl examples of server push and can not get them to work. Does anyone have an idiot proof example of a working server push or...
7
by: DW | last post by:
Hi, Here is my question. I want to push security prices to the desktop from the server. Whenever there is a new price in the database, the server notifies the client. How can this be done in...
6
by: Martin Holmgaard | last post by:
I have written the following function to be used for flood filling in a bitmap. The function works fine on Windows XP Prof and Windows 2000 server, but on Windows 2003 server it return a stack...
4
by: batista | last post by:
Hello All, my prob. is that i have a web server, and i want it to send fresh data,whenver it is available(from sum other source), to a webpage. Now i used refresh, but i want to use an...
2
by: batista | last post by:
Hi there, I want to push data from server to client.(No pulling and no "smart pulling" like using xmlhttp) I heard that one possible solution is to use TCP connection using ActX Controls or...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: Crisco www.misericordia.com.br | last post by:
Hi I m working on WEBRADIO Software. im using Windows media encoder 9 SDK on Windows 2003 server using VB.NET. My current scenario is my soundcard . My application will push my server the...
5
by: Mark Goldin | last post by:
Can I create a push server using ASP technology? Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.