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

curl-and-php

windows cookie problem

From: S B <sdesignb_at_yahoo.com>
Date: Wed, 15 Mar 2006 10:29:30 -0800 (PST)

I have problems retriving cookies using php and curl.

Server configuration:
PHP Version 4.3.10
Apache 1.3
libcurl/7.11.2 OpenSSL/0.9.7c zlib/1.1.4
windows XP Professional

Script:

<?php
$url = "http://www.google.com";
$file = rand(1000, 9999);
$path = "coky/".$file.".txt";
$user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $path);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $path);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($ch);
echo curl_error($ch);
curl_close($ch);
echo $result;
?>

when I acces the cookie folder it is empty, no cookies are saved, not even the cookie file is made.

If I use the same script on a linux box the cookies are saved ok, can you please hlep me. What is wrong?
I don`t have linux at home and I don`t know how to use it this is why I need to build my server on a windows box.

                
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.

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