Php Program to Send a Message from Client(php program) to Server (java program)
What this program does? 1. Make Use of php Socket Programming including with IP address and port number of Server (java program). 2. First starts a server (server.java) which will be always running listening to a port 8080(Server.java) 3. Client (Client.php) sends a number (message) to the server (Sever.java). 4. Server receives this number or messages from Client.php which is run on your Apache server 1. This is Client .php treated as Client which is run on your xampp or wamp server. <?php $address = '172.16.50.122'; // java server ip address $port = 8080; // port number $socket = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp')); socket_connect($socket, $address, $port); $message = '<?xml version="1.0"?>'; $message .= '<root>'; $message .= '<attribute-value attribute="sample attribure">'; $message .= '<value>sample value</value>'; $message .= ...