Posting a textarea form with cURL
- by Joey
How would I go about posting a textarea form?
<form method="post" action="/user/test/shoutbox/add" id="shoutPost" class="clearit">
<input name="formtoken" type="hidden" value="852f8fde54190fa5f9aa47172d492f829c1b"/>
<input type="hidden" name="backto" value="/user/text/shoutbox" />
<textarea id="shoutmsg" name="message"></textarea>
<input type="submit" name="submit" class="confirmButton" value="Post" id="sbPost" />
This should work right?
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POST, 1);
$postfields .= "&message=".$msg;
$postfields .= "&submit=sbPost";
curl_setopt($ch, CURLOPT_POSTFIELDS,$postfields);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$page = curl_exec($ch);
but it's not posting for some reason...