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

curl-and-php

need a bit of help to fill this form

From: Regis Maltais <regismalt_at_hotmail.com>
Date: Wed, 11 Feb 2004 06:26:53 -0500

Hi,

I cannot fill this form with cURL and PHP:
http://www.sheltercare.com/french/gift/form.asp?cuid=

The form does not contain the info that I have provided through cURL.

Can someone can help me?

thanks

Regis

here is my code snippet:

<?php
        $url = "http://www.sheltercare.com/french/gift/form.asp?cuid=";
        $ch = curl_init($url); // initialize curl handle

        //curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
    curl_setopt($ch, CURLOPT_HEADER,1);

    $agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $agent);

    curl_setopt($ch,
CURLOPT_REFERER,"http://www.sheltercare.com/french/index.asp");

        curl_setopt($ch, CURLOPT_FAILONERROR,1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); // allow redirects
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
        curl_setopt($ch, CURLOPT_TIMEOUT,15); // times out after 4s

    curl_setopt($ch, CURLOPT_VERBOSE,1);
    curl_setopt ($ch, CURLOPT_COOKIEJAR, "C:\Program
Files\EasyPHP\www\SPCA\Foster5\cookie.txt");
        //curl_setopt($ch, CURLOPT_COOKIEJAR, '-');

        curl_setopt($ch, CURLOPT_POST,1); // set POST method
        curl_setopt($ch, CURLOPT_POSTFIELDS,
"cuid=&first_name=Regis&last_name=Maltais"); // add POST fields
        //curl_setopt ($ch,CURLOPT_CUSTOMREQUEST , $req)

        $result = curl_exec($ch); // run the whole process

        echo "Result = " . $result;

        if (curl_error($ch))
       echo "Error: " . curl_errno($ch). " " . curl_error($ch);

        curl_close($ch);
?>

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
Received on 2004-02-11