 |
Title: Interserver Communications Marked Cool (Review this resource) Author: davidlo Posted On: 2004-12-20 Category: Home > PHP Tutorials
Popularity:
Description: How to let two separated HTTP and PHP systems communicate with each other without using sockets.
Total Hits: 1436 Total Votes: 0
Total Points: 0 (1 reviews)
Interserver Communications
Part I
For some applications, you may need two independent HTTP servers to exchange information with each other. Given the runtime and possible Safe Mode restrictions imposed on the PHP setup, using sockets is not a viable solution. However, you can simply just have the two servers communicate by having them retrieve the results of a PHP script. Let us start with an example:
requester.php:
<?php
$str=file_get_contents("http://server/client.php");
echo "Server returned $str"; ?>
client.php:
<?php echo "OK";
?>
Provided the files are in the correct places, running requester.php should output
Server returned OK
Now that we have the basics down, let's move on to basic authentication, as most of the time we don't want outsiders just typing in client.php in their web browser to gain access to it.
|
|
 |