cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Help for login whith Https

From: Michael Horowitz <michael_at_yourcomputerconsultant.com>
Date: Mon, 01 Sep 2008 08:40:36 -0400

What error are you getting?

I would also suggest you verify the user id and password you have is
correct. Sometimes it can be something as simple as that.

I would also check the receiving servers log to see what response they
are giving when they receive your post?

Michael Horowitz
Your Computer Consultant
http://yourcomputerconsultant.com
561-394-9079

Lucas eu?! wrote:
> Hello,
>
> Thanks, but unfortunatelly it didn't work. Please, is there any soluction?
>
>
>
> Date: Sun, 31 Aug 2008 15:46:36 -0400
> From: Michael Horowitz <michael_at_yourcomputerconsultant.com
> <mailto:michael_at_yourcomputerconsultant.com>>
> Subject: Re: Help for login whith Https
> To: curl with PHP <curl-and-php_at_cool.haxx.se
> <mailto:curl-and-php_at_cool.haxx.se>>
> Message-ID: <48BAF51C.2030402_at_yourcomputerconsultant.com
> <mailto:48BAF51C.2030402_at_yourcomputerconsultant.com>>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> The way I have sent a user id and password is
>
> curl_setopt($ch, CURLOPT_USERPWD, 'userid:password');
>
> Michael Horowitz
> Your Computer Consultant
> http://yourcomputerconsultant.com <http://yourcomputerconsultant.com/>
> 561-394-9079
>
>
>
> Lucas eu?! wrote:
> > Hello!
> >
> > My code is:
> >
> > <?
> >
> > $id = "xxxxxx";
> > $password = "xxxxxx";
> > $cookie_file_path = "cookiejar.txt";
> > $loginURL = "https://pagseguro.uol.com.br/Default.aspx";
> > $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4)
> > Gecko/20030624 Netscape/7.1 (ax)";
> > $POSTFIELDS = 'Email='.$id.'&txtSenha='.$
> password.'&btnLogin=Entrar';
> >
> > $ch = curl_init();
> > curl_setopt($ch, CURLOPT_URL,$loginURL);
> > curl_setopt($ch, curlOPT_SSL_VERIFYHOST, 2);
> > curl_setopt($ch, CURLOPT_HEADER, 1);
> > curl_setopt($ch, curlOPT_USERAGENT, $agent);
> > curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
> >
> > curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
> > curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
> > curl_setopt($ch, curlOPT_SSL_VERIFYPEER, FALSE); // this line makes it
> > work under https
> >
> > $result=curl_exec($ch);
> >
> >
> >
> > $temparr = explode("id=\"__VIEWSTATE\" value=\"",$result);
> > $__VIEWSTATE = explode("\" />",$temparr[1]);
> >
> > $temparr2 = explode("id=\"__EVENTVALIDATION\" value=\"",$result);
> > $__EVENTVALIDATION = explode("\" />",$temparr2[1]);
> >
> >
> > $POSTFIELDS =
> >
> 'Lili1_OffsetY=0&Lili1_OffsetX=0&ckbSalvarEmail=on&Email='.$id.'&txtSenha='.$password.'&btnLogin=Entrar&__VIEWSTATE='.$__VIEWSTATE[0].'&__EVENTVALIDATION='.$__EVENTVALIDATION[0];
> >
> >
> >
> >
> > curl_setopt($ch, CURLOPT_URL,$loginURL);
> > curl_setopt ($ch, CURLOPT_POST, TRUE );
> > curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);
> > curl_setopt($ch, CURLOPT_HEADER, false);
> > curl_setopt($ch, CURLOPT_TIMEOUT, 30);
> > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
> > curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
> >
> >
> > $result=curl_exec($ch);
> >
> >
> > curl_close ($ch);
> >
> >
> > echo($result);
> > die();
> > ?>
> >
> > See result on http://www.agentesite.com.br/curl/curl_pagseguro.php ;
> >
> >
> > Server Error in '/' Application.
> >
> >
> > I need login in https://pagseguro.uol.com.br/Login.aspx , for test
> > login use login = noisae_at_hotmail.com <mailto:noisae_at_hotmail.com>
> <mailto:noisae_at_hotmail.com <mailto:noisae_at_hotmail.com>> and
> > pass = test123
> >
> > Please i need help !! ...
> >
> > Thank's!!!!!
> ------------------------------------------------------------------------
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-09-01