pclown
10-27-2008, 12:07 PM
making PHP scripts talk to each other
I'm currently trying to write a simple real-time messaging program using javascript and PHP and don't want to use continuous polling to receive messages. My plan is to make the javascript submit a get request to phpscript1 whenever it receives a message, then make the php not respond until it receives a message from the other person who will send a post request to phpscript2. The problem is then to make phpscript1 somehow know when phpscript2 has received a message without using some form of continuous polling. I feel there must be a way to do this because there are so many other websites which seem to do the same thing but I don't really know what. Various sources have suggested that it may be possible using port scanning or something but this seems to conflict with my fairly limited understanding of ports.
I'm currently trying to write a simple real-time messaging program using javascript and PHP and don't want to use continuous polling to receive messages. My plan is to make the javascript submit a get request to phpscript1 whenever it receives a message, then make the php not respond until it receives a message from the other person who will send a post request to phpscript2. The problem is then to make phpscript1 somehow know when phpscript2 has received a message without using some form of continuous polling. I feel there must be a way to do this because there are so many other websites which seem to do the same thing but I don't really know what. Various sources have suggested that it may be possible using port scanning or something but this seems to conflict with my fairly limited understanding of ports.
