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

curl-and-php

Re: Ignoring dns lookups in php / lib curl.

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Fri, 17 Dec 2004 10:14:59 +0100 (CET)

On Fri, 17 Dec 2004, Kevin Revill wrote:

> I already found that snippet of code on the curl site, but i can not find
> the php curl variant. Anyone can enlighten me of it?

Ok, allow me to write this off the top of my head and please bear with my lack
of PHP skills:

         $header[] = "Host: my.wonderful.host";
         $url = "http://10.0.0.1/";

         $ch = curl_init($url);

         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
         curl_setopt($ch, CURLOPT_URL, $url);

         // possibly some more options

         $result = curl_exec($ch);
         curl_close($ch);

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-12-17