![]() |
# 1 |
עסק רשום [?]
|
PHP| בעיה בSSL Socket - PayPal
אני מנסה לקרוא אתר כלשהוא בעל אבטחת SSL ויש לי בעיות בחיבור אליו.
זה השגיאה: קוד:
HTTP/1.1 400 Bad Request Date: Mon, 29 Nov 2010 13:32:55 GMT Server: Apache Content-Length: 226 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> </body></html> קוד:
$host = 'ssl://www.paypal.com'; $socket = fsockopen($host,443,$errno,$errstr,30); if ( $socket ) { $request = "GET {$path} HTTP/1.1\r\n"; $request .= "Host: {$host}\r\n"; $request .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; he; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729)\r\n"; $request .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"; $request .= "Accept-Language: he,en-us;q=0.7,en;q=0.3\r\n"; $request .= "Accept-Encoding: gzip,deflate\r\n"; $request .= "Accept-Charset: windows-1255,utf-8;q=0.7,*;q=0.7\r\n"; $request .= "Keep-Alive: 115\r\n"; $request .= "Connection: keep-alive\r\n"; $request .= "Cookie: {$cookies}\r\n"; $request .= "Connection: close\r\n\r\n"; fwrite($socket,$request); $info=""; while ( !feof($socket) ) { $info .= fgets($socket,128); } return $info; fclose($socket); } |
![]() |
![]() |
# 2 | |
חבר וותיק
|
ניסית?
ציטוט:
|
|
![]() |
![]() |
# 3 | |
Whatever
|
ציטוט:
קוד:
$host = 'ssl://www.paypal.com'; אבל בכ"מ, אני גם לא רואה שהגדרת את $path - אתה שולח GET ואז תוכן ריק ולכן מקבל בחזרה Bad Request.
__________________
תומר |
|
![]() |
![]() |
# 5 | |
Whatever
|
ציטוט:
אני לא בטוח אם "SSL://" היא כתובת תקפה ב fsockopen. לדעתי לא, אבל אם אתה טוען שכן - בכיף. תנסה להסיר את השורות הבאות: קוד:
$request .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"; $request .= "Accept-Language: he,en-us;q=0.7,en;q=0.3\r\n"; $request .= "Accept-Encoding: gzip,deflate\r\n"; $request .= "Accept-Charset: windows-1255,utf-8;q=0.7,*;q=0.7\r\n"; $request .= "Cookie: {$cookies}\r\n"; $request .= "Connection: close\r\n\r\n";
__________________
תומר |
|
![]() |
![]() |
# 6 |
משתמש - היכל התהילה
|
הצעה שלי, תעבוד עם CURL
http://php.net/manual/en/ref.curl.php
__________________
קו ישר, כי אפשר גם אחרת |
![]() |
![]() |
# 8 | |
חבר וותיק
|
ציטוט:
|
|
![]() |
![]() |
חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים) | |
כלים לאשכול | |
תצורת הצגה | |
|
|