Differences
This shows you the differences between two versions of the page.
old-content:fifo_client_sample [2005/12/23 01:00] |
old-content:fifo_client_sample [2005/12/23 01:00] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | <table border=" | ||
+ | < | ||
+ | <form action="<? | ||
+ | <tr> | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | <tr align=" | ||
+ | </ | ||
+ | |||
+ | <?php | ||
+ | $cmd = NULL; | ||
+ | if (isset($_POST[' | ||
+ | $cmd = $_POST[' | ||
+ | } | ||
+ | if (isset($_POST[' | ||
+ | $host=" | ||
+ | $port = 12345; | ||
+ | $pos = strpos($cmd," | ||
+ | if ($pos == NULL) { | ||
+ | $fifo_cmd = ": | ||
+ | } else { | ||
+ | $t1 = substr($cmd, | ||
+ | $t2 = substr($cmd, | ||
+ | $fifo_cmd = ": | ||
+ | } | ||
+ | $timeout = 5; | ||
+ | $fp = fsockopen ($host, $port, $errno, $errstr, $timeout); | ||
+ | if (!$fp) { | ||
+ | die(" | ||
+ | } else { | ||
+ | echo "< | ||
+ | // write the user string to the socket | ||
+ | fputs ($fp, $fifo_cmd); | ||
+ | // get the result | ||
+ | while ($result = fgets ($fp, 1024)) { | ||
+ | echo " | ||
+ | } | ||
+ | // close the connection | ||
+ | fclose ($fp); | ||
+ | } | ||
+ | } | ||
+ | ?> | ||
+ | |||
+ | </ | ||
+ | </ |