|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-04-16 20:40 UTC] trevor at ridgebizdev dot com
Description:
------------
Based on the nature of this problem, it's ugly to reduce to a single line of code. When ViewState (a session variable) is over 20k, the PHP request languages (cURL, PECL_HTTP, and file_get_contents()) all fail.
Test script:
---------------
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, "https://www.budgettruck.com/Pick-Up-Location.aspx");
curl_setopt($ch, CURLOPT_REFERER, "https://www.budgettruck.com/Pick-Up-Location.aspx");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata4);
curl_setopt($ch, CURLOPT_COOKIE, $cookie_str);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 55);
curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header_r);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla 5.0");
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_PROXY, "localhost");
curl_setopt($ch, CURLOPT_PROXYPORT,"8888");
$response4 = curl_exec($ch);
Expected result:
----------------
$response4 should be the html sourcecode of the "Drop Off Location Page".
Actual result:
--------------
HTTP/1.1 302 Moved Temporarily
Content-Type: text/html; charset=utf-8
Location: https://www.budgettruck.com/Default.aspx?tabid=54&error=An%20unexpected%20error%20has%20occurred&content=0
X-UA-Compatible: IE=edge
X-Powered-By: ASP.NET
Content-Length: 231
Expires: Wed, 16 Apr 2014 18:36:12 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Wed, 16 Apr 2014 18:36:12 GMT
Connection: keep-alive
Set-Cookie: language=en-US; path=/; secure; HttpOnly
Set-Cookie: datacenter=ptc
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.budgettruck.com/Default.aspx?tabid=54&error=An%20unexpected%20error%20has%20occurred&content=0">here</a>.</h2>
</body></html>
Patchespatchinappropriate (last revision 2014-04-16 20:41 UTC by trevor at ridgebizdev dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
@trevor at ridgebizdev dot com it's also ugly to post a half baked snippet like that. I've generated the post data for your example like $postdata4 = str_repeat('x', 42000); ignoring all the undefined variables. Also not using proxy, and this works, though despite warnings. C:\php-sdk\php54\vc9\x86\php-src>e:\snaps\php-5.4.21-nts-Win32-VC9-x86\php -n -d extension_dir=e:\snaps\php-5.4.21-nts-Win32-VC9-x86\ext -d extension=php_curl.dll bug67090.php Warning: curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments in C:\php-sdk\php54\vc9\x86\php-src\bug67090.php on line 16 string(11060) "HTTP/1.1 100 Continue Expires: Thu, 17 Apr 2014 07:09:54 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache HTTP/1.1 302 Moved Temporarily Content-Type: text/html; charset=utf-8 Location: https://www.budgettruck.com/ErrorCookiesNotEnabled.aspx X-UA-Compatible: IE=edge X-Powered-By: ASP.NET Content-Length: 172 Expires: Thu, 17 Apr 2014 07:09:55 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Thu, 17 Apr 2014 07:09:55 GMT Connection: keep-alive Set-Cookie: .ASPXANONYMOUS=nt49352QzwEkAAAAZWFiNmNmY2MtMWZjMy00Mzg5LTk2ZDYtNDFjOWM1OTBiNmEw0; expires=Wed, 25-Jun-2014 17:49:54 GMT; path=/; HttpOnly Set-Cookie: language=en-US; path=/; secure; HttpOnly Set-Cookie: datacenter=ftc HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-UA-Compatible: IE=edge X-Powered-By: ASP.NET Expires: Thu, 17 Apr 2014 07:09:56 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Thu, 17 Apr 2014 07:09:56 GMT Content-Length: 9664 Connection: keep-alive Set-Cookie: .ASPXANONYMOUS=vtQF4J2QzwEkAAAAYzUzMWQwMGQtOWM5ZS00OGIzLWE1NjUtYTk4MWIzNzA5NTcz0; expires=Wed, 25-Jun-2014 17:49:55 GMT; path=/; HttpOnly Set-Cookie: ASP.NET_SessionId=sks3zs0bvd4oymdlx5xdg1am; path=/; secure; HttpOnly Set-Cookie: 51D=3155378975999999999; expires=Fri, 31-Dec-9999 23:59:59 GMT; path=/; secure; HttpOnly Set-Cookie: datacenter=ftc <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head"> ............................................. and so forth the page ...................................... I think your issue is your proxy or something in the data you send. Please recheck that and post a reliable self enclosed reproduce case. Thanks