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

curl-and-php

Re: Please Help me! php + curl + xml

From: Renato Bonicio <renatobonicio_at_gmail.com>
Date: Thu, 9 Mar 2006 14:30:59 -0300

Thanks very much!!!!! now i can get the information i need!

On 3/9/06, Sukhbir Gill <sukhbirgs_at_gmail.com> wrote:
>
> <?php
>
>
> //https://relayadmin.nocsp.com.br/telemar/httpsapi/getUserInfo.do?user_email=
> MLachman_at_icatuhartford.com.br&username=support&password=jkl12345
>
> $ch = curl_init();
> $_URL = '
> https://relayadmin.nocsp.com.br/telemar/httpsapi/getUserInfo.do';
> $_POST = 'user_email=MLachman_at_icatuhartford.com.br
> &username=support&password=jkl12345';
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> /** SETUP_1 **/
> /**
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_URL,$_URL );
> curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST );
> **/
>
> /** SETUP_1 gave me this error **/
> /**
> HTTP Status 500 - 1004 - User Not Found
> type Status report
> message 1004 - User Not Found
> description The server encountered an internal error (1004
> - User
> Not Found) that prevented it from fulfilling this request.
> Apache Tomcat/5.0.19
> **/
>
>
>
> //** SETUP_2**/
> curl_setopt($ch, CURLOPT_URL,$_URL.'?'.$_POST );
>
> //** SETUP_2 Result **/
> /**
> -- USER DATA BEGIN --
> USER_EMAIL: MLachman_at_icatuhartford.com.br
> FIRST_NAME: Moises
> LAST_NAME: Lachman
> MSISDN: null
> EXPIRATION_TIME: none
> LAST_CONNECTED: 2006-03-09
> USER_STATUS: 0
> CLIENT_STATUS: 1
> -- USER DATA END --
> **/
>
>
> curl_setopt($ch, CURLOPT_TIMEOUT, 300);
>
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
>
> curl_setopt($ch, CURLOPT_DNS_CACHE_TIMEOUT, 2678400);
> curl_setopt($ch, CURLOPT_HTTPHEADER, array("Referer: MYHOST ",
> "Host: localhost" ,
> "Accept:
> image/gif,image/jpeg,image/pjpeg,text/plain,text/html,*/*",
> "Pragma:",
>
> "Content-Type:image/gif"));
>
> // This option had no effect on the results
> curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
>
> $reply = curl_exec($ch);
> echo "<pre>";
> print_r($reply);
> echo "</pre>";
> ?>
>
> On 3/9/06, Renato Bonicio <renatobonicio_at_gmail.com> wrote:
> >
> > sorry..the address is
> >
> https://relayadmin.nocsp.com.br/telemar/httpsapi/getUserInfo.do?user_email=MLachman@icatuhartford.com.br&username=support&password=jkl12345
> >
> >
> >
> >
> >
> > On 3/9/06, Renato Bonicio <renatobonicio_at_gmail.com> wrote:
> > >
> > >
> > > Hi All!!
> > >
> > > I am with a interesting problem..
> > >
> > > If i try to do a post via browser address bar (
> >
> https://relayadmin.nocsp.com.br:8443/telemar/httpsapi/getUserInfo.do?user_email=MLachman@icatuhartford.com.br&username=support&password=jkl12345
> > ),
> > > i get the response that i need!
> > >
> > > but i need to get this response by the internal php code,
> > > the only way i know is curl
> > > but the cod is not working, it could not connect and i dont know the
> > reason, since using the browser it works perfectly!!!!!
> > >
> > > Please help me!
> > >
> > >
> > >
> > >
> > > $str=
> > "user_email=MLachman_at_icatuhartford.com.br
> &username=support&password=jkl12345
> > ";
> > >
> > > $ch = curl_init();
> > > curl_setopt($ch, CURLOPT_URL, "
> > https://relayadmin.nocsp.com.br:8443/telemar/httpsapi/getUserInfo.do");
> > >
> > > curl_setopt($ch, CURLOPT_POST, 1 );
> > > curl_setopt($ch, CURLOPT_POSTFIELDS, $str );
> > > curl_setopt($ch, CURLOPT_PORT, 443);
> > > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> > >
> > > $postResult = curl_exec($ch);
> > >
> > > if (curl_errno($ch)) {
> > > print curl_error($ch);
> > > }
> > > curl_close($ch);
> > > print "$postResult";
> > >
> > >
> > >
> >
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >
> >
> >
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-03-09