Passing parameter from webpage to batch file

Hi,I am having problem,I have batch file running continuously that will listen and receive data from the connected clients, for example I have 4 clients connected from the socket,…client A,B,C and D, now I have command to be send to the client example in client C,but this command will be send through web page,…I have no idea how can I bring this command to the running batch file or pass this command to the running batch file so that this will be send to the specified client.

Thank you in advance.

here is the code


<?php


for(;;){
$addip = 'xxx.xxx.xx.xx';
$port = xxxx;
$cond = true;
    mylistener($addip ,$port ,$cond);
}



function   mylistener($addip ,$port ,$cond){

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);



socket_set_option($sock, SOL_SOCKET, SO_REUSEADDR, 1);


socket_bind($sock, $address, $port);


socket_listen($sock);



$clients = array($sock);

while ($cond) {
    $file = fopen('txt.log','a');

    $read = $clients;
    $write = NULL;
    $except = NULL;
    $tv_sec = 0;

    if (socket_select($read, $write , $except,  $tv_sec) < 1)
	    continue;
	


    if (in_array($sock, $read)) {

        $clients[] = $newsock = socket_accept($sock);

        $key = array_search($sock, $read);
		
        unset($read[$key]);

    }


    foreach ($read as $read_sock) {


        $data = @socket_read($read_sock, 1024, PHP_NORMAL_READ);


        if ($data === false) {

            $key = array_search($read_sock, $clients);
            unset($clients[$key]);
            break;
        }


        $data = trim($data);


        if (!empty($data)) {
                 foreach ($clients as $send_sock) {

                    socket_write($send_sock, $mycommand);
			
                }

            fwrite($file,$data."\
");
        }

    } // end of reading foreach

    fclose($file);
}


socket_close($sock);
}

?>