You will need to have everythng on the same page. Your program ends once the page does. Here are some examples straight from the manual.
<?php $fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br>\n"; } else { fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n"); while (!feof($fp)) { echo fgets ($fp,128); } fclose ($fp); } ?> The example below shows how to retrieve the day and time from the UDP service "daytime" (port 13) in your own machine. Example 2. Using UDP connection <?php $fp = fsockopen("udp://127.0.0.1", 13, $errno, $errstr); if (!$fp) { echo "ERROR: $errno - $errstr<br>\n"; } else { fwrite($fp,"\n"); echo fread($fp, 26); fclose($fp); } ?> *********** REPLY SEPARATOR *********** On 02/01/2003 at 3:10 PM Gareth Hastings wrote: >One last question, do you know how or what method I would use to do this >via a php script? Everything I've tried fails. Like > > >Makeconnection.php ><? > $mysocket = pfsocketopen('my.server.com', '1234'); >?> >-------------- > > >testconenction.php ><? > fputs($mysocket, "VERSION\n"); > echo fgets($mysocket, 255); >?> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php