curl - php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rashmi
Forum Newbie
Posts: 3
Joined: Thu May 03, 2007 9:32 am

curl - php

Post by rashmi »

If anyone know how to use curl to fetch page content from authanticate url please guide me. It's urgent.

My requirement :
I am in try to develop address book importer in php.
address book importer from webmail yahoo, msn, gmail.. etc available on net.
But I want to develope same for others by myself.
I used curl for this purpose.

if you have any idea about this problem solution please help me soon.

Thanks for reply n guidence.
Last edited by rashmi on Mon May 21, 2007 11:42 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Can you be a bit more specific about this "authanticate"?
rashmi
Forum Newbie
Posts: 3
Joined: Thu May 03, 2007 9:32 am

Post by rashmi »

My requirement :
I am in try to develop address book importer in php.
address book importer from webmail yahoo, msn, gmail.. etc available on net.
But I want to develope same my own code.
I used curl for this purpose.

if you have any idea about this problem solution please help me soon.
reneeshtk
Forum Newbie
Posts: 2
Joined: Fri May 18, 2007 5:37 pm

Post by reneeshtk »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi

There is one method using cURL you can do it...

Code: Select all

$curl="abc.com";
//curl_headdata contains the fields of the form
$curl_headdata="SLD=$domainame&TLD=$tlds&submit=submit";

$curlconn = curl_init();
   
      curl_setopt($curlconn, CURLOPT_POST, true);
      curl_setopt($curlconn, CURLOPT_POSTFIELDS, "$curl_headata");
   
   curl_setopt($curlconn, CURLOPT_URL, $curl_url);
   curl_setopt($curlconn, CURLOPT_RETURNTRANSFER, true);
   $curlresult = curl_exec($curlconn);
echo $crulresult;

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

You probably don't even need curl. Have a little look at fopen() or file_get_contents() and you will see that you can use any number of protocols.... this means you can fetch remote files with just the URL.

Code: Select all

$googleHomePage = file_get_contents('http://www.google.com');
You're going to have to parse them yourself though, but curl would never help you with that either.
Good luck.
Post Reply