943,936 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2980
  • PHP RSS
May 13th, 2005
0

Fgets + Ssl

Expand Post »
Hi,

Im having a slight problem with fgets and ssl.
PHP Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3.  
  4. function monkey($method,$protocal,$port,$domain,$path,$data,$query){
  5.  
  6.  
  7. if($method=="POST"){
  8.  
  9.  
  10. $fp = fsockopen($protocal."://".$domain, $port, $errno, $errstr, 30);
  11.  
  12. if (!$fp) {
  13. echo $errstr." (".$errno.")<br />\n";
  14. } else {
  15. $out .= "POST /".$path."?".$query." HTTP/1.1\r\n";
  16. $out .= "Host: ".$domain."\r\n";
  17. $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
  18. $out .= "Content-Length: " . strlen($req) . "\r\n";
  19. $out .= "Connection: Close\r\n\r\n";
  20. $out .= $req;
  21.  
  22. fputs ($fp, $out);
  23. while (!feof($fp)) {
  24. echo fgets($fp, 128);
  25. }
  26. fclose($fp);
  27. }
  28.  
  29. }
  30. }
  31. $data['foo']="Hello Post data";
  32. monkey("POST","ssl","443","domaingoeshere.com","",$data,"a=blag");
  33.  
  34. ?>

Fgets throws an error at me.
Is there something obvious that ive done wrong?
Apache is settup correctly and php is compiled with ssl support.
Last edited by John Smith; May 13th, 2005 at 5:20 am. Reason: Ooops
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
John Smith is offline Offline
2 posts
since May 2005
May 13th, 2005
0

Re: Fread + Ssl

When connecting to hotmail I get this error:
(Through POST and SSL)

(1)HTTP/1.1 200 OK
(2)Cache-Control: no-cache
(3)Pragma: no-cache
(4)Content-Length: 312
(5)Content-Type: text/html
(6)Expires: Fri, 13 May 2005 08:33:37 GMT
(7)Server: Microsoft-IIS/6.0
(8)PPServer: PPV: 25 H: TK2PPMLOG2B03 V: 1192
(9)cachecontrol: no-store
(10)P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
(11)Date: Fri, 13 May 2005 08:34:36 GMT
(12)Connection: close
(13)
<br />
<b>Warning</b>: fgets(): SSL: fatal protocol error in <b>/home/william/public_html/hotmail.php</b> on line <b>46</b><br />
(14)<HTML><HEAD>.... (page content)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
John Smith is offline Offline
2 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: compatible PHP db
Next Thread in PHP Forum Timeline: I think this is a php problem?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC