The function sendtohost:

-----BEGIN CODE----
function sendToHost($host,$method,$path,$data,$useragent=0)
 // Supply a default method of GET if the one passed was empty
 if (empty($method))
  $method = 'GET';
 $method = strtoupper($method);
 $fp = fsockopen($host,443);
 if ($method == 'GET')
  $path .= '?' . $data;
 fputs($fp, "$method $path");
 fputs($fp, "Host: $host\n");
 fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
 fputs($fp, "Content-length: " . strlen($data) . "\n");
 if ($useragent)
  fputs($fp, "User-Agent: MSIE\n");
 fputs($fp, "Connection: close\n\n");
 if ($method == 'POST')
  fputs($fp, $data);

 while (!feof($fp)) {
          $buf .= fgets($fp,128);
          echo("buf: " . $buf);
 return $buf;
-----END CODE----

Is great for posting results to a regular http site.  But what I need to do
is post to a secure site (https).  I looked through some of the php
documentation and couldn't find anything about manually encrypting the data
to send or anything like that.

Any help would be greatly appreciated.


Jeremy Reed

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to