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

curl-and-php

Problem With Form Post

From: Tig <tig_at_online.be>
Date: Tue, 17 Aug 2004 16:50:27 +0200

Hi,

I am having some problem posting data to a form using POST method and
curl+php.

The result my scripts gives me is the same url with all fileds (except
password -psword-) filled in, but it doesn't do anything else (like showing me
the result of the submit)

I was wondering if this is due to an error in my code or some protection/code
on the website.

Here is my code:

<?php

$url = "http://www.kingsofchaos.com";

$post['username'] = '';
$post['pword'] = '';
$post['uname'] = 'Tiggy-Dragonz';
$post['uemail'] = 'tig_at_online.be';
$post['psword'] = 'xxxxxx';

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 1 );
curl_setopt($ch, CURLOPT_VERBOSE, 1 );
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.0;Windows
98; DigExt)");
curl_setopt($ch, CURLOPT_POSTFIELDS, $post );
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_REFERER, "http://www.kingsofchaos.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo "$result";
curl_close($ch);
?>

Any ideas?

Greetings

Thierry

PS Submitting data php-style login.php?uname='blabla'&xxxxx doesn't work
eather.
Received on 2004-08-17