Re: [PHP] cURL Help - Posting a Form

2004-09-11 Thread Nick Wilson

* and then Nick Wilson declared
> hi all, 
> 
> Im trying to get the following php code to output the
> 'success'/'failure' page from posting a form to a site. The problem is

H... it helps if you are submitting to the 'action' url of
course sigh

-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] cURL Help - Posting a Form

2004-09-11 Thread Nick Wilson
hi all, 

Im trying to get the following php code to output the
'success'/'failure' page from posting a form to a site. The problem is
that there is no output at all, so i must be doing somthing silly, but
cant work out what! ;-)

## Code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/form.html";);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_REFERER, "http://nowhere.com";);
curl_setopt($ch, CURLOPT_USERAGENT, "CommentMaker 0.8");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"static=$static&entry_id=$entry_id&author=" . urlencode($author) . "&email=" . 
urlencode($email) ."&url=$myurl&bakecookie=Forget+Info&text=" . urlencode($text) . 
"&post=+Post+");

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

## End Code

Anyone see the problem/mistake?

Much thx...
  
-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php