Here's the simple script that will do the trick!  This is what I use with
Equifax before I start using cURL.  You can substitute the "HOSTNAME",
"HOSTPORT" for something else.

  $errno = 0;
  $errstr= "";

  $socket = fsockopen(HOSTNAME,HOSTPORT,&$errno,&$errstr,30);
  if(!$socket || $errno) {
      echo "Could Not Connect to Equifax !!!!<br>";
      return 0;

  $senddata = $headerstr;
  $senddata .= $sendstr;
  $senddatalen = strlen($senddata);


  list($code,$inqdata) = getResponse($socket);

  if(!$code) {
      logAction(-2,"Break Up\n");
      echo "Error Communicating With Equifax !!!!<br>";
      return 0;


"Richard Lynch" <[EMAIL PROTECTED]> wrote in message[]...
> >I want to issue an fsockopen command to pass a POST data set to a remote
> >server script.
> If you do a Google for "posttohost and 'Rasmus Lerdorf'" you'll find one
> already written for you... :-)
> >I understand the pricipals behind fsockopen, but I cannot figure out the
> >string I need to pass to POST the data - I will be emulating the output
> >from a <Form> element.
> You would need to read a whole lot of HTTP RFC's to be sure you have it
> correct.
> Fortunately, Rasmus read all of those already :-)
> >In addition, how do I detect a successful operation? before closing the
> Yeah, the server will send back something if it worked/failed...
> --
> Like Music?

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to