Re: Curl(): maximum length of POST arguments?



On 2/7/06 16:52, in article 9kqfa250r72epe0990gl6qklv9heu644fa@xxxxxxx,
"Andy Hassall" <andy@xxxxxxxxxxx> wrote:


// create a new curl resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.blahbl.com/
zippo/Search.ASP?WCI=AddToPortFolio");
curl_setopt($ch, CURLOPT_POSTFIELDS, urlencode($dezrez_query));

You've just encoded all the "&" and "=" separators; you should be encoding
the
keys and values separately and joining them up with "&" and "=".

Done that. Still fails. I get returned a 1, which I assume indicates curl
succeeded,

That depends on the options.

but nothing else returned to the $string I pass the result of the
curl to.

With the settings above, cURL would just print the results to the browser,
not
return any content. See CURLOPT_RETURNTRANSFER.

If you want more information, ask for it using curl_getinfo(), curl_error(),
and CURLOPT_VERBOSE.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_REFERER, "http://www.blah.com/bibble/Search.ASP";);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$login_contents = curl_exec($ch);
$error = curl_error($ch);
print $error;
print $login_contents;
curl_close($ch);

Pretty sure there is no curl error. Trying variations of this doesn't give
me any feedback apart from that 1.

Capturing the data sent back and forth using curl and also the normal form
posts, it looks like some cookie() are being sent as well during the form
posts, which might explain why its not working in some browsers and isn't in
others. Ithought I had it pinned down to a id cookie for the domain, but
apparantly not.

I think I might as well give up on this before I it becomes an even bigger
time-sucker.

Thanks to all for your brains

.



Relevant Pages

  • Re: Automatic login to a web page
    ... This is mentioned in my isp login page "Cookies must be enabled" ... And with third example [using Curl] ... sub body_callb { ... If it sets a cookie, Curl can handle that too, but it gets more ...
    (comp.lang.perl.misc)
  • Re: [PHP] Help with CURL please
    ... I'm trying to access this URL using CURL and grab ... Now the problem is that in order to access that site, a Cookie must be ... redirects you to http://enterprisedirectory.ucr.edu, sets the cookie ... http://enterprisedirectory.ucr.edu (thus leaving my script) and then ...
    (php.general)
  • Re: CURL and $_SESSION problem
    ... >> the US Federal Government, and you know how the government is! ... > See the headers it sends to its clients (and to index.php CURL calls). ... Once I get the cookie then I ... I can get my own PHPSESSID but I can't get the REMOTE ...
    (comp.lang.php)
  • Re: Help to automatically traverse a login session
    ... Session and/or Cookie. ... Within this logged-in area, there are links ... Such "web scraping" can be done with cURL ... <?php echo 'Just another PHP saint'; ...
    (comp.lang.php)
  • Re: Help to automatically traverse a login session
    ... Session and/or Cookie. ... Within this logged-in area, there are links ... Such "web scraping" can be done with cURL ... <?php echo 'Just another PHP saint'; ...
    (comp.lang.php)