Re: [PHP] PHP CURL JSON POST Firebug
On 04/09/2012 19:14, ioan...@btinternet.com wrote: On 04/09/2012 18:41, Matijn Woudt wrote: On Tue, Sep 4, 2012 at 7:35 PM, ioan...@btinternet.com wrote: I am hoping someone can spot what is missing here. I am getting null result from curl-ing a page with json post variables. I try this url in my Firefox browser - http://www.targetsite.com/search.php#somevar.someothervar (#somevar.someothervar are irrelevant, I think, as I get the curl variables from Firebug below.) In Firebug, this shows: POST http://www.targetsite.com/ajax/search.xml In Firebug, below this link are tabs for: Headers, Post, Response, XML and Cookies. Post tab shows like: JSON VAR1 1 VAR2 "2012-09-12" VAR3 null CACHED [] OPTIONSnull To prove there is output, the Firebug Response tab shows: various JSON encoded stuff The above is what I am trying to curl. My php code: $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); //target page from Firebug above: curl_setopt($ch, CURLOPT_URL, "http://www.targetsite.com/ajax/search.xml";); //I was not sure how to represent CACHED [], so set it to null try "CACHED"=>array() $data = array( "VAR1" => 1, "VAR2" => "2012-09-12", "VAR3" => null, "CACHED"=>null, "OPTIONS"=>null, ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //make the request $result = curl_exec($ch); //this returns null Any ideas where to go with this? Maybe I need to include the Cookies? I use the above php and curl functions normally so it's all installed on the server. John It might be that the site is using sessions/cookies. Have a look at the header data with firebug. Not sure if that's the problem, to find out what's really going on, call echo curl_error($ch); after curl_exec to find out what went wrong exactly. If you still don't know how to proceed, paste the result of the curl_error call in your reply. - Matijn I added the cookies to the post array. I changed php array to "CACHED"=>array() for the JSON "CACHED":[], and corrected php's null to NULL. It is not returning any error. The browser was showing 'resource not present' before I added the cookies to the post array, now it just returns null $result. Looks like I am transcribing something incorrectly. John I eventually sorted this out. Solution involved: POST params needed to be json_encoded $params=json_encode(array( "name" => "value" )); Thanks to http://www.lornajane.net/posts/2011/posting-json-data-with-php-curl curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); Also, included headers as array and set application type as json: curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($post)) ); Set encoding to auto-detect: curl_setopt( $ch, CURLOPT_ENCODING, ""); John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP CURL JSON POST Firebug
On 04/09/2012 18:41, Matijn Woudt wrote: On Tue, Sep 4, 2012 at 7:35 PM, ioan...@btinternet.com wrote: I am hoping someone can spot what is missing here. I am getting null result from curl-ing a page with json post variables. I try this url in my Firefox browser - http://www.targetsite.com/search.php#somevar.someothervar (#somevar.someothervar are irrelevant, I think, as I get the curl variables from Firebug below.) In Firebug, this shows: POST http://www.targetsite.com/ajax/search.xml In Firebug, below this link are tabs for: Headers, Post, Response, XML and Cookies. Post tab shows like: JSON VAR1 1 VAR2 "2012-09-12" VAR3 null CACHED [] OPTIONSnull To prove there is output, the Firebug Response tab shows: various JSON encoded stuff The above is what I am trying to curl. My php code: $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); //target page from Firebug above: curl_setopt($ch, CURLOPT_URL, "http://www.targetsite.com/ajax/search.xml";); //I was not sure how to represent CACHED [], so set it to null try "CACHED"=>array() $data = array( "VAR1" => 1, "VAR2" => "2012-09-12", "VAR3" => null, "CACHED"=>null, "OPTIONS"=>null, ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //make the request $result = curl_exec($ch); //this returns null Any ideas where to go with this? Maybe I need to include the Cookies? I use the above php and curl functions normally so it's all installed on the server. John It might be that the site is using sessions/cookies. Have a look at the header data with firebug. Not sure if that's the problem, to find out what's really going on, call echo curl_error($ch); after curl_exec to find out what went wrong exactly. If you still don't know how to proceed, paste the result of the curl_error call in your reply. - Matijn I added the cookies to the post array. I changed php array to "CACHED"=>array() for the JSON "CACHED":[], and corrected php's null to NULL. It is not returning any error. The browser was showing 'resource not present' before I added the cookies to the post array, now it just returns null $result. Looks like I am transcribing something incorrectly. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP CURL JSON POST Firebug
On Tue, Sep 4, 2012 at 7:35 PM, ioan...@btinternet.com wrote: > I am hoping someone can spot what is missing here. I am getting null result > from curl-ing a page with json post variables. > > I try this url in my Firefox browser - > > http://www.targetsite.com/search.php#somevar.someothervar > > (#somevar.someothervar are irrelevant, I think, as I get the curl variables > from Firebug below.) > > In Firebug, this shows: > > POST http://www.targetsite.com/ajax/search.xml > > In Firebug, below this link are tabs for: Headers, Post, Response, XML and > Cookies. Post tab shows like: > > JSON > VAR1 1 > VAR2 "2012-09-12" > VAR3 null > CACHED [] > OPTIONSnull > > To prove there is output, the Firebug Response tab shows: > > > various JSON encoded stuff > > The above is what I am trying to curl. > > My php code: > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > curl_setopt($ch, CURLOPT_POST, 1); > > //target page from Firebug above: > curl_setopt($ch, CURLOPT_URL, > "http://www.targetsite.com/ajax/search.xml";); > > //I was not sure how to represent CACHED [], so set it to null try "CACHED"=>array() > $data = array( > "VAR1" => 1, > "VAR2" => "2012-09-12", > "VAR3" => null, > "CACHED"=>null, > "OPTIONS"=>null, > ); > curl_setopt($ch, CURLOPT_POSTFIELDS, $data); > > //make the request > $result = curl_exec($ch); > > //this returns null > > Any ideas where to go with this? Maybe I need to include the Cookies? I use > the above php and curl functions normally so it's all installed on the > server. > > John It might be that the site is using sessions/cookies. Have a look at the header data with firebug. Not sure if that's the problem, to find out what's really going on, call echo curl_error($ch); after curl_exec to find out what went wrong exactly. If you still don't know how to proceed, paste the result of the curl_error call in your reply. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP CURL JSON POST Firebug
I am hoping someone can spot what is missing here. I am getting null result from curl-ing a page with json post variables. I try this url in my Firefox browser - http://www.targetsite.com/search.php#somevar.someothervar (#somevar.someothervar are irrelevant, I think, as I get the curl variables from Firebug below.) In Firebug, this shows: POST http://www.targetsite.com/ajax/search.xml In Firebug, below this link are tabs for: Headers, Post, Response, XML and Cookies. Post tab shows like: JSON VAR1 1 VAR2 "2012-09-12" VAR3 null CACHED [] OPTIONSnull To prove there is output, the Firebug Response tab shows: various JSON encoded stuff The above is what I am trying to curl. My php code: $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); //target page from Firebug above: curl_setopt($ch, CURLOPT_URL, "http://www.targetsite.com/ajax/search.xml";); //I was not sure how to represent CACHED [], so set it to null $data = array( "VAR1" => 1, "VAR2" => "2012-09-12", "VAR3" => null, "CACHED"=>null, "OPTIONS"=>null, ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //make the request $result = curl_exec($ch); //this returns null Any ideas where to go with this? Maybe I need to include the Cookies? I use the above php and curl functions normally so it's all installed on the server. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php cURL with SSL problem ??
> -Original Message- > From: LKSunny [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 25, 2008 2:32 PM > To: php-general@lists.php.net > Subject: [PHP] php cURL with SSL problem ?? > > Hello, > > i want get https data with cURL, however just can via set > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); > > by the moment, i need turn curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, > true); > i got some idea is "ca certificates", however how can i do it ? > > this is crt file ? can not make from openssl ? if can make from > openssl, any > sample command ? > and how to use ? > > i am using Windows (WIN32) > apache2.2+php5 I'm not sure I entirely understand your question... but here goes: Yes, you can make your own CRT/KEY/CER files using OpenSSL. http://www.freebsd.org/doc/en/books/handbook/openssl.html has some instructions. Hope this helps, // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php cURL with SSL problem ??
Hello, i want get https data with cURL, however just can via set curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); by the moment, i need turn curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); i got some idea is "ca certificates", however how can i do it ? this is crt file ? can not make from openssl ? if can make from openssl, any sample command ? and how to use ? i am using Windows (WIN32) apache2.2+php5 Thank You Very Much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP CURL
Hi Fahad, May be you wil find something helpful at http://curl.haxx.se/mail/archive-2003-03/0137.html -- Keep Smiling Shafiq Rehman (ZCE) http://www.phpgurru.com | http://shafiq.pk Cell: +92 300 423 9385 On Nov 19, 2007 11:45 AM, Fahad Pervaiz <[EMAIL PROTECTED]> wrote: > I am looking forward to write a script that can send invite to contacts in > gmail,hotmail, yahoo and aol. I think it is possible to write it using php > CURL. If yes can any one suggest how? > and can any one help me write this script or join me to write this script? > > -- > Regards > Fahad Pervaiz > www.ecommerce-xperts.com > (Shopping Cart System) >
[PHP] PHP CURL
I am looking forward to write a script that can send invite to contacts in gmail,hotmail, yahoo and aol. I think it is possible to write it using php CURL. If yes can any one suggest how? and can any one help me write this script or join me to write this script? -- Regards Fahad Pervaiz www.ecommerce-xperts.com (Shopping Cart System)
Re: [PHP] php, curl and aol addressbook import problem
On Fri, January 5, 2007 10:31 pm, Iqbal Naved wrote: > I am desparately looking for a solution for importing address book > from aol > webmail to my browser. I found some commercial solution (such as, > http://svetlozar.net) which was done using cURL. But couldnt find any > php > classes to implement it. Anyone can help me how to implement this ? As > far > as i could go is this code which can successfully log in to aol : > > $login = 'abcd'; > $pass = '1234'; > > $url = "https://my.screenname.aol.com/_cqr/login/login.psp";; > $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; > $postvars = > "screenname=".$login."&password=".$pass."&submitSwitch=1&siteId=aolcomprod&mcState=initialized&authLev=1"; > $cookie = "cookies/test"; > @unlink($cookie); > > $ch = curl_init($url); > curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); > curl_setopt($ch, CURLOPT_CAINFO, "E:/aol_grab/curl-ca-bundle.crt"); > curl_setopt($ch, CURLOPT_HEADER, 1); > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars); > curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); > curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > $content = curl_exec ($ch); > file_get_contents("http://d02.webmail.aol.com/22250/aol/en-us/Suite.aspx";); > //print_r(curl_getinfo($ch)); > //echo "\n\ncURL error number:" .curl_errno($ch); > //echo "\n\ncURL error:" . curl_error($ch); > curl_close ($ch); > unset($ch); > echo "".htmlentities($content); > ?> > > and I was able to log in to it successfully..the output is as below > HTML Code: > > HTTP/1.0 200 OK Date: Wed, 20 Dec 2006 09:31:47 GMT Server: > Apache > Pragma: No-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: > RSP_COOKIE=type=23&name=SXFiYWxuYXZlZA%3D%3D&stype =100; > Domain=.aol.com; Expires=Sat, 15-Dec-2007 09:31:47 GMT; Path=/ > Set-Cookie: > SNS_TT=AAppcWJhbG5hdmVkRYkDAwAAEAABADzZgUOA2md9Z10 > eZXKIoglrjoCeCrbwVT0pwLi4eVd8mDKn%2BVKco%2FRRi%2F5 > rNTsm5vMgc1UlyzEDQ%2BXxYeQ%3D; Domain=my.screenname.aol.com; > Expires=Fri, > 19-Jan-2007 09:31:47 GMT; Path=/ Set-Cookie: MC_CMP_ESK=NonSense; > Domain=.aol.com; Path=/ Set-Cookie: > SNS_SKWAT=diAyLjAga2lkIDEgdDF5SDJxYmROcHhxN0FHbEh6 > V1hDMmJLc0djPQ%3D%3D-b0o7Q4xCU%2F39IESbtoTm9mBdSL47fxxUnmD4X1Pn82%2Fol% > 2B03%2BtxOLynThOHeQsaL5xdmerZnzZT34sulbmtlrezipaPL > kGMHiXQBbDQpCZb53AT7EPRZ2sWEvYfeP0a9rf%2FDn%2F2ER3 > 2h0rLA5%2B7UMs6NmHharvEJQCFkTVYUHyjUa6btTL8twXF4Jm > siXUX0uXBuOHibk6Pl9lKtKJj779U%2BiXUU4oBiSpcg6Q%2FY > KJUvGNsk4cjDURDglR9SsQL0iCJ2S1w4YGA%3D; Domain=screenname.aol.com ; > Path=/ > Set-Cookie: SNS_SC=diAxLjAga2lkIDEgQ2R1RXNSeDJGTDZ3SmNNMXRkMUt > hQ25kdEhZPQ%3D%3D-dwYGM2lmn8IsM5qbIMCD4cF876hxn28LVqa2CrLuSNY%2FClN5 > 8OIf%2Bg1GbhwkQ8c4%2BoZTQgtZjkKb0gS4x9xI2v1HzzyBQU > 7%2FUGAuyvgR9SWpqJmjzOpUJldJIJHA43WwgahRfwXBKCp8Ci > B%2FPMLCa4bSsNdpgaEVUgc%2FrdXCOOU%3D; Domain=my.screenname.aol.com; > Path=/ > Set-Cookie: SNS_L0=diAxLjAga2lkIDEgUUpsdVVrUWtzb21SOFhPdGo1SFo > 2R2swQzJzPQ%3D%3D-RgHJcTIzyWP%2BQIb7S6lE%2BpdmQv1XVmfP; Domain= > screenname.aol.com ; Expires=Tue, 15-Jul-2036 09:31:47 GMT; Path=/ > Set-Cookie: SNS_LDC=1 aolcomprod 1 1166607107 0 1166607107 0; Domain= > my.screenname.aol.com; Expires=Fri, 19-Jan-2007 09:31:47 GMT; Path=/ > Set-Cookie: SNS_AA=asrc=2&sst=1166607107; Domain=.aol.com; Path=/ > P3P: > CP="PHY ONL PRE STA CURi OUR IND" Content-length: 1505 Cache-control: > no-cache Content-language: en-US Content-type: text/html;charset=utf-8 > Connection: closeScr > > > > But i dont know how to fetch the email addresses from the contact > list. Any > one can help me on this ? Login to AOL "by hand" and compare the two outputs. Then look for the link or button that accesses your address book. Then have your curl script do that, just like it logged in. You will want your COOKIEJAR to be your COOKIEFILE as well for all subsequent curl operations. COOKIEJAR is for the cookies coming "in" and then COOKIEFILE sends them out again -- Make them the same to maintain state. (The Usual) They are different just in case you need to do that, but it's kinda rare, I think. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php, curl and aol addressbook import problem
Hi, I am desparately looking for a solution for importing address book from aol webmail to my browser. I found some commercial solution (such as, http://svetlozar.net) which was done using cURL. But couldnt find any php classes to implement it. Anyone can help me how to implement this ? As far as i could go is this code which can successfully log in to aol : https://my.screenname.aol.com/_cqr/login/login.psp";; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $postvars = "screenname=".$login."&password=".$pass."&submitSwitch=1&siteId=aolcomprod&mcState=initialized&authLev=1"; $cookie = "cookies/test"; @unlink($cookie); $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_CAINFO, "E:/aol_grab/curl-ca-bundle.crt"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $content = curl_exec ($ch); file_get_contents("http://d02.webmail.aol.com/22250/aol/en-us/Suite.aspx";); //print_r(curl_getinfo($ch)); //echo "\n\ncURL error number:" .curl_errno($ch); //echo "\n\ncURL error:" . curl_error($ch); curl_close ($ch); unset($ch); echo "".htmlentities($content); ?> and I was able to log in to it successfully..the output is as below HTML Code: HTTP/1.0 200 OK Date: Wed, 20 Dec 2006 09:31:47 GMT Server: Apache Pragma: No-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: RSP_COOKIE=type=23&name=SXFiYWxuYXZlZA%3D%3D&stype =100; Domain=.aol.com; Expires=Sat, 15-Dec-2007 09:31:47 GMT; Path=/ Set-Cookie: SNS_TT=AAppcWJhbG5hdmVkRYkDAwAAEAABADzZgUOA2md9Z10 eZXKIoglrjoCeCrbwVT0pwLi4eVd8mDKn%2BVKco%2FRRi%2F5 rNTsm5vMgc1UlyzEDQ%2BXxYeQ%3D; Domain=my.screenname.aol.com; Expires=Fri, 19-Jan-2007 09:31:47 GMT; Path=/ Set-Cookie: MC_CMP_ESK=NonSense; Domain=.aol.com; Path=/ Set-Cookie: SNS_SKWAT=diAyLjAga2lkIDEgdDF5SDJxYmROcHhxN0FHbEh6 V1hDMmJLc0djPQ%3D%3D-b0o7Q4xCU%2F39IESbtoTm9mBdSL47fxxUnmD4X1Pn82%2Fol% 2B03%2BtxOLynThOHeQsaL5xdmerZnzZT34sulbmtlrezipaPL kGMHiXQBbDQpCZb53AT7EPRZ2sWEvYfeP0a9rf%2FDn%2F2ER3 2h0rLA5%2B7UMs6NmHharvEJQCFkTVYUHyjUa6btTL8twXF4Jm siXUX0uXBuOHibk6Pl9lKtKJj779U%2BiXUU4oBiSpcg6Q%2FY KJUvGNsk4cjDURDglR9SsQL0iCJ2S1w4YGA%3D; Domain=screenname.aol.com ; Path=/ Set-Cookie: SNS_SC=diAxLjAga2lkIDEgQ2R1RXNSeDJGTDZ3SmNNMXRkMUt hQ25kdEhZPQ%3D%3D-dwYGM2lmn8IsM5qbIMCD4cF876hxn28LVqa2CrLuSNY%2FClN5 8OIf%2Bg1GbhwkQ8c4%2BoZTQgtZjkKb0gS4x9xI2v1HzzyBQU 7%2FUGAuyvgR9SWpqJmjzOpUJldJIJHA43WwgahRfwXBKCp8Ci B%2FPMLCa4bSsNdpgaEVUgc%2FrdXCOOU%3D; Domain=my.screenname.aol.com; Path=/ Set-Cookie: SNS_L0=diAxLjAga2lkIDEgUUpsdVVrUWtzb21SOFhPdGo1SFo 2R2swQzJzPQ%3D%3D-RgHJcTIzyWP%2BQIb7S6lE%2BpdmQv1XVmfP; Domain= screenname.aol.com ; Expires=Tue, 15-Jul-2036 09:31:47 GMT; Path=/ Set-Cookie: SNS_LDC=1 aolcomprod 1 1166607107 0 1166607107 0; Domain= my.screenname.aol.com; Expires=Fri, 19-Jan-2007 09:31:47 GMT; Path=/ Set-Cookie: SNS_AA=asrc=2&sst=1166607107; Domain=.aol.com; Path=/ P3P: CP="PHY ONL PRE STA CURi OUR IND" Content-length: 1505 Cache-control: no-cache Content-language: en-US Content-type: text/html;charset=utf-8 Connection: closeScr But i dont know how to fetch the email addresses from the contact list. Any one can help me on this ? Thanks in Advance Naved
Re: [PHP] php + cURL issue
I'm adding additional bounty to my problem for anyone who can help me fix it. I'll send you a Rio Cali Sport 256 MB MP3 player - new in box. Comes with the sport ear buds, arm strap, few other accessories. You can google it for the details of it. Great for a stocking stuffer or as an extra gadget for kicks (as if we all dont have enough). =D To restate the problem for those that have forgotten, one server is working (win 2k, other is not win 2k3) - same code, same versions of everything. I've created a page for you to view the code / the verbose data / the phpInfo() for the two servers. Its a script to auto-login to a site - not particularly yahoo, the problem occurs with all cookie based logins, so using this yahoo script as an example. Again, the win2k server ==IS== working with that code - so its dosent appear to be a code issue. You can view the debug information here : http://70.84.198.254/index.html thanks again, Nate Nielsen [EMAIL PROTECTED] - Original Message - From: "Curt Zirzow" <[EMAIL PROTECTED]> To: Sent: Friday, November 18, 2005 11:04 PM Subject: Re: [PHP] php + cURL issue On Fri, Nov 18, 2005 at 06:08:16PM -0600, Nate Nielsen wrote: Okay, I've added the verbose output to copare exactly what is happening between the two versions - thanks to Curt, the verbose info shows there IS something different happening. To recap, the code is exactly the same, the php version is the same (same files even), the php.ini is the same (except drive letters), the curl version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3). The only difference is that one server is Win2k and the other is Win2003 (and of course one is working and other is not). yeah, it does seem to be *not* a bug in curl versions. Now it is very clear that something different is happening on the two different servers. I've created a page to list the phpInfo() data, the code that is being run, and the VERBOSE information outputted by cURL. You can view the information here : http://70.84.198.254/index.html ok.. the key thing i noticed in that nice little side by side display you put together is this: When you are sending the first post data look at the end of it curl is complaining about something: Ok side: name=login_form&.src=auc&.tries=1&.done=TML 4.01//EN&.md5=&.hash=&.js=&.partner=&.slogin=adsherrouse&.intl=us&.fUpdate=&.prelog=&.bid=&.aucid=&.challenge=.01//EN&.yplus=&.chldID=&pkg=&hasMsgr=0&passwd=doglogan&submit=Sign In< HTTP/1.1 302 Found Bad Side: name=login_form&.src=auc&.tries=1&.done=TML 4.01//EN&.md5=&.hash=&.js=&.partner=&.slogin=adsherrouse&.intl=us&.fUpdate=&.prelog=&.bid=&.aucid=&.challenge=.01//EN&.yplus=&.chldID=&pkg=&hasMsgr=0&passwd=doglogan&submit=Sign In* Curl_xxx_rcvs returned -1, block = TRUE You will notice that the ok side is sends back a 302 while the bad side is returning an error from curl. I'm not sure what that Curl_xxx_rcvs.. line means but it seems is the source of the problem. A other thing you would want to compare is the actual results that come back from the request. On the otherhand, what you seem to be doing is very likely to break sooner than later, i'm not sure why you want to proxy a complex web authentication system such as yahoo's Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + cURL issue
On Fri, Nov 18, 2005 at 06:08:16PM -0600, Nate Nielsen wrote: > Okay, I've added the verbose output to copare exactly what is happening > between the two versions - thanks to Curt, the verbose info shows there IS > something different happening. > > To recap, the code is exactly the same, the php version is the same (same > files even), the php.ini is the same (except drive letters), the curl > version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3). The > only difference is that one server is Win2k and the other is Win2003 (and > of course one is working and other is not). yeah, it does seem to be *not* a bug in curl versions. > > Now it is very clear that something different is happening on the two > different servers. I've created a page to list the phpInfo() data, the > code that is being run, and the VERBOSE information outputted by cURL. > > You can view the information here : http://70.84.198.254/index.html ok.. the key thing i noticed in that nice little side by side display you put together is this: When you are sending the first post data look at the end of it curl is complaining about something: Ok side: name=login_form&.src=auc&.tries=1&.done=TML 4.01//EN&.md5=&.hash=&.js=&.partner=&.slogin=adsherrouse&.intl=us&.fUpdate=&.prelog=&.bid=&.aucid=&.challenge=.01//EN&.yplus=&.chldID=&pkg=&hasMsgr=0&passwd=doglogan&submit=Sign In< HTTP/1.1 302 Found Bad Side: name=login_form&.src=auc&.tries=1&.done=TML 4.01//EN&.md5=&.hash=&.js=&.partner=&.slogin=adsherrouse&.intl=us&.fUpdate=&.prelog=&.bid=&.aucid=&.challenge=.01//EN&.yplus=&.chldID=&pkg=&hasMsgr=0&passwd=doglogan&submit=Sign In* Curl_xxx_rcvs returned -1, block = TRUE You will notice that the ok side is sends back a 302 while the bad side is returning an error from curl. I'm not sure what that Curl_xxx_rcvs.. line means but it seems is the source of the problem. A other thing you would want to compare is the actual results that come back from the request. On the otherhand, what you seem to be doing is very likely to break sooner than later, i'm not sure why you want to proxy a complex web authentication system such as yahoo's Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + cURL issue
Okay, I've added the verbose output to copare exactly what is happening between the two versions - thanks to Curt, the verbose info shows there IS something different happening. To recap, the code is exactly the same, the php version is the same (same files even), the php.ini is the same (except drive letters), the curl version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3). The only difference is that one server is Win2k and the other is Win2003 (and of course one is working and other is not). Now it is very clear that something different is happening on the two different servers. I've created a page to list the phpInfo() data, the code that is being run, and the VERBOSE information outputted by cURL. You can view the information here : http://70.84.198.254/index.html You can see from looking at the verbose information that something is definitely happening differently on the dev/working server. Again, I'm putting a bounty on this issue. If you can help me fix this, 6 months of free hosting on one of my dedicated (you choose US or Germany) based server (with your own IP). If you dont need/want hosting, I'll give you some cash. Up to you. Any help is greatly GREATLY appreciated!! Thanks again, Nate Nielsen [EMAIL PROTECTED] - Original Message - From: "Curt Zirzow" <[EMAIL PROTECTED]> To: Sent: Thursday, November 17, 2005 9:28 PM Subject: Re: [PHP] php + cURL issue On Thu, Nov 17, 2005 at 04:00:21PM -0600, Nate Nielsen wrote: I'm having an issue with cURL. I have installed it on two different boxes, one is working properly, and another isn't. The script auto login's a user to a site. One server it works as expected and logs the user in, the other it does not. It appears the cookie data that is being saved is different on the two machines from the login. what are the differences in the cookies? have you tried curl_setopt() with: curl_setopt($ch, CURLOPT_VERBOSE); curl_setopt($ch, CURLOPT_STDERR, $filehandle); // where to log have you looked at the output on the login request to ensure that the content is being returned as expected. What does the code look like? Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + cURL issue
On Thu, Nov 17, 2005 at 04:00:21PM -0600, Nate Nielsen wrote: > I'm having an issue with cURL. I have installed it on two different boxes, > one is working properly, and another isn't. > > The script auto login's a user to a site. One server it works as expected > and logs the user in, the other it does not. It appears the cookie data that > is being saved is different on the two machines from the login. > what are the differences in the cookies? have you tried curl_setopt() with: curl_setopt($ch, CURLOPT_VERBOSE); curl_setopt($ch, CURLOPT_STDERR, $filehandle); // where to log have you looked at the output on the login request to ensure that the content is being returned as expected. What does the code look like? Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + cURL issue
also, as another note - the php version and cURL version is identical on the two machines - the main difference between them being that one is windows 2k server and the other one is windows 2k3 server (std ed) any ideas ? thanks - Original Message - From: "Nate Nielsen" <[EMAIL PROTECTED]> To: Sent: Thursday, November 17, 2005 4:00 PM Subject: [PHP] php + cURL issue I'm having an issue with cURL. I have installed it on two different boxes, one is working properly, and another isn't. The script auto login's a user to a site. One server it works as expected and logs the user in, the other it does not. It appears the cookie data that is being saved is different on the two machines from the login. The code itself is identical. The result on the two servers is different. I've fiddled with this thing for a couple weeks, and now its too late to mess with it anymore as I have a launch target I need to hit. What I'd like is a php / IIS guru to help me fix this. I will give you remote desktop access to the server and you can take it away from there. I just need you to get the script running on the server the same as the other. The script is already there, its very simplistic, only about 50 lines or so, no database interaction, nothing fancy at all. I'm not a strong PHP guy, so its very simplistic. (again though, it works on other server, so its not a code issue) In return, I'll give you free hosting on one of my dedicated servers for 6 months. This is not your average shared hosting, I dont host sites for a living, I only host clients I code for - so there is only a handful of people on each server. In fact, the server you will be on, you will be the only person on it at this time. You'll have access to PHP (obviously), ColdFusion MX 7 (the latest, greatest version), MSSQL 2k and/or mySQL (different server), and if you need additional services, we can work that out. Please email me if you are interested in helping or if you have any ideas please!! Thanks in advance! - Nate Nielsen [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php + cURL issue
I'm having an issue with cURL. I have installed it on two different boxes, one is working properly, and another isn't. The script auto login's a user to a site. One server it works as expected and logs the user in, the other it does not. It appears the cookie data that is being saved is different on the two machines from the login. The code itself is identical. The result on the two servers is different. I've fiddled with this thing for a couple weeks, and now its too late to mess with it anymore as I have a launch target I need to hit. What I'd like is a php / IIS guru to help me fix this. I will give you remote desktop access to the server and you can take it away from there. I just need you to get the script running on the server the same as the other. The script is already there, its very simplistic, only about 50 lines or so, no database interaction, nothing fancy at all. I'm not a strong PHP guy, so its very simplistic. (again though, it works on other server, so its not a code issue) In return, I'll give you free hosting on one of my dedicated servers for 6 months. This is not your average shared hosting, I dont host sites for a living, I only host clients I code for - so there is only a handful of people on each server. In fact, the server you will be on, you will be the only person on it at this time. You'll have access to PHP (obviously), ColdFusion MX 7 (the latest, greatest version), MSSQL 2k and/or mySQL (different server), and if you need additional services, we can work that out. Please email me if you are interested in helping or if you have any ideas please!! Thanks in advance! - Nate Nielsen [EMAIL PROTECTED]
RE: [PHP] PHP+ Curl (on Unix)
Thanks, Jason! __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___+- On Mon, 3 Sep 2001, Jason Murray wrote: > > As I understand it, PHP 4 has CURL support. > >1) is enabling the curl extension a substitute for installing the curl > > package? > > In other words, if I enable the extension, do I still need to instal > > the CURL package? > > You need to install CURL, and tell PHP where it is when you compile > it, in order to use the extensions. > > > 2) Can I install curl without ROOT access? > > Probably, but I wouldn't know... > > > 3) Does FOPEN() NOT support HTTPS, or do I need to do something > > special. > > Probably not. As I understand it, you need to install some kind > of patch to your system to allow you to open URLs with fopen(). > That's unlikely to support encrypted transactions (https). > > > 4) How else can I innitiate a HTTPS connection on a *NIX system? > > Is Socket the only solution? > > CURL works nicely... I doubt you'd get far with sockets since you > would have to encrypt and decrypt on your own. > > Jasoon > > -- > Jason Murray > [EMAIL PROTECTED] > Web Developer, Melbourne IT > "Work now, freak later!" > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP+ Curl (on Unix)
> As I understand it, PHP 4 has CURL support. >1) is enabling the curl extension a substitute for installing the curl > package? > In other words, if I enable the extension, do I still need to instal > the CURL package? You need to install CURL, and tell PHP where it is when you compile it, in order to use the extensions. > 2) Can I install curl without ROOT access? Probably, but I wouldn't know... > 3) Does FOPEN() NOT support HTTPS, or do I need to do something > special. Probably not. As I understand it, you need to install some kind of patch to your system to allow you to open URLs with fopen(). That's unlikely to support encrypted transactions (https). > 4) How else can I innitiate a HTTPS connection on a *NIX system? > Is Socket the only solution? CURL works nicely... I doubt you'd get far with sockets since you would have to encrypt and decrypt on your own. Jasoon -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP+ Curl (on Unix)
Hello everyone! I'm a little lost. As I understand it, PHP 4 has CURL support. 1) is enabling the curl extension a substitute for installing the curl package? In other words, if I enable the extension, do I still need to instal the CURL package? 2) Can I install curl without ROOT access? If so, then please tell me how. I've search the online manual, but didn't notice the answer. I'm still searching. 3) Does FOPEN() NOT support HTTPS, or do I need to do something special. 4) How else can I innitiate a HTTPS connection on a *NIX system? Is Socket the only solution? Please help. -John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP cURL problem
I am using PHP 4.0.6 and when I run the following code I get nothing back except the error code 27 and a message saying SSL: couldn't create a context I can run the same thing from the command line and it works perfectly does anyone have any ideas on this? Thanks in advance for any help, Steve Dowell $q_auth = $login.":".$pw; $fp = fopen("c:Scan_files/test_10.xml","w"); $ch = curl_init("https://www.foo.com/msp/some_report_list.php";); curl_setopt($ch, CURLOPT_USERPWD,$q_auth); curl_setopt($ch, CURLOPT_FAILONERROR, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_FILE,$fp); curl_setopt($ch, CURLOPT_NOPROGRESS,0); curl_setopt($ch, CURLOPT_VERBOSE,1); $result=curl_exec ($ch); echo curl_errno($ch).""; echo curl_error($ch); curl_close ($ch); echo "result=".$result; $fp = fclose; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP & cURL Tutorial
Is there something along these lines somewhere out there? If so, could someone point me in the right direction? Chris