curl-and-php
Re: Transferring open-Id Info to Google apps script through CURL to run app script in the background
Date: Thu, 19 Sep 2013 09:33:38 -0400
Stephen,
cURL acts 'like' a browser, in that it sends & receives POST & GET requests and manages the cookies associated. To accomplish what you want, you'll need to research the HTTP Headers and then set-up the curlopts to mimic the real requests.
If you don't already have access to the header info, I suggest using LiveHTTPHeaders (a Firefox plugin) or Chrome's developer window to log requests (persistent logging is helpful) via a 'real' login. Then build step-by-step, a script to store cookies and perform the login. Those cookies are most likely needed for subsequent requests to verify access.
In essence, you'll call curl_exec($ch) several times and will modify the behavior, for instance: POST/GET, post data, target & referrer, along with possibly capturing some values from $returndata after each. The header info log from above will help you build this list of pages to request by script.
Because a login is involved, this will likely take some time and further learning about cURL. It will likely also increase the length of your script!
A few references,
http://curl.haxx.se/libcurl/php/
http://us1.php.net/manual/en/function.curl-setopt.php
This is a good board for more specific questions.
David
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2013-09-19