Page 2 of 2

Posted: Fri Apr 06, 2007 8:55 pm
by John Cartwright
I already told you ;)

Posted: Fri Apr 06, 2007 8:59 pm
by ol4pr0
In that case i think i ´m missing a post, cause i dont see it.

Posted: Fri Apr 06, 2007 9:48 pm
by John Cartwright
Like I said, you only need a single curl_init()

Posted: Sat Apr 07, 2007 2:34 pm
by ol4pr0
Got it working.. :)

However still have one problem, Transfer Encoding: chunked. Any ideas on How to avoid that.

my Code now

Code: Select all

$cookie_jar = tempnam('/tmp','cookie');
	$cookie = "";
	$ch = curl_init();
	curl_setopt ($ch, CURLOPT_URL, "url/login.php");
	curl_setopt ($ch, CURLOPT_HEADER, 1);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, VERBOSE, 1);
	curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
	curl_setopt($ch, CURLOPT_POSTFIELDS, "myPostFields");
	curl_exec($ch);
	curl_close($ch);

	$ch = curl_init();
	curl_setopt ($ch, CURLOPT_URL, "url/create-mailbox.php");
	curl_setopt ($ch, CURLOPT_HEADER, 1);
	curl_setopt($ch, VERBOSE, 1);
	curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_jar);
	curl_setopt($ch, CURLOPT_COOKIE, $cookie);
	curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, "myPostFields");
	$response = curl_exec($ch);
	curl_close($ch);

Output
HTTP/1.1 200 OK
Date: Sat, 07 Apr 2007 19:31:05 GMT
Server: Apache/1.3.37 (Unix) PHP/5.2.0 with Suhosin-Patch mod_ssl/2.8.28 OpenSSL/0.9.7e-p1
X-Powered-By: PHP/5.2.0
Expires: Sun, 16 Mar 2003 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Last-Modified: Sat, 07 Apr 2007 19:31:06 GMT
Cache-Control: post-check=0, pre-check=0
Transfer-Encoding: chunked
Content-Type: text/html

Posted: Tue May 22, 2007 12:50 am
by rashmi
I am developing web mail's addressbook importer using php.
I am using curl for this.

mine problem is : my script runs well on server apache Apache 2.0 +php PHP Version 4.4.2 +mysql

[1] when i tried same script on iis 6+ win 2k3 + php 5.2.1 - 1 script will not returns me the result othres works fine.

[2] when i tired the same script with WAMP - php 4.2 - not getting result appropriately

[3] I cann't connect to mssql in iis 6+ win 2k3 + php 5.2.1 configuration. i already copied enough files to system32 directory.

If anyone can help me in this problems please guide me soon.

with regards.

-Rashmi