Forum Moderators: buckworks
However, on my tests (from belahost.com this round) I get this success & error at the same time:
===PASTE===
Successfully Posted to your Script!
Your Script's Reply:
-------------------------------
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 14 Sep 2006 15:02:35 GMT
Content-type: text/html
X-Powered-By: PHP/5.0.5
HTTP/1.0 500 WebInterface disabled
Pragma: no-cache
Cache-Control: no-cache
Content-type: text/html;charset=utf-8
Connection: close
Requested page cannot be found. Please contact firewall administrator.
===PASTE OVER===
My server adminsitartor says it is impossible that port 80 should be used for a socket because that is reserved for http.
Uhm: anyone has any idea on whether using port 80 is ok as it seems, or on whether that code above could be generated by belahost.com rather than my server? Anyone stumbled into something similar before?
$socket=fsockopen($protocol.$domain, $port, $errno, $errstr, 60);
if($socket===false){
print 'Socket error.';
}
else{
$iwrote=fwrite($socket, $headers.$myPOSTDATA);
while(!feof($socket)){
$paypal_RESPONSE=fgets($socket, 4096);
print $paypal_RESPONSE;/*got the error here*/
thanks
[edited by: Alberto at 4:55 pm (utc) on Sep. 14, 2006]
Nonetheless, I still would need to make this Paypal work, after all I know there is plenty of win servers where paypal works fine.
Is anyone who may have an idea what kinda attempts I may do? I obviously talked with my server admin but you never know how long they may take to work things out, so this is why I was looking for suggestions here. Maybethey just won't work out.
Anyone met such a problem, or has suggestions about alternative ports?
ps 443 doesn't work as well, but after all I'm not on ssl
$parameters = 'cmd=_notify-validate';
foreach ($_POST as $key => $value)
{
$parameters .= '&' . $key . '=' . urlencode($value);
}
//uncomment as needed
$server = 'www.paypal.com';
//$server = 'www.sandbox.paypal.com';
$fp = @fsockopen('ssl://' . $server, 443, $errno, $errstr, 30);
$header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n" .
'Host: ' . $server . "\r\n" .
'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
'Content-Length: ' . strlen($parameters) . "\r\n" .
'Connection: close' . "\r\n\r\n";
@fputs($fp, $header . $parameters);
while (!@feof($fp))
{
$result = @fgets($fp, 1024);
if (($result == 'VERIFIED') ¦¦ ($result == 'INVALID'))
{
break;
}
}
@fclose($fp);
my code is like yours, of course I posted only a snippet of it, the one where the issue arises. As said the issue is not that it doesn't send the data, it is that after it has sent it, I get that message rather than the verified or invalid response. Port 443 yields the same result.
Anyone used any other port than 80 or 443? The issue is the port. Maybe someone else met this issue before.
Thanks