I have to write a PHP Application which needs to post to wiki blogs. For example see the below page
http://calendario.simcolombia.com/groups/informacingeneral/blog/
In this page there is one little "+" button in the right hand side of the page. Basically my app needs to click on this "+" button. When we click on this "+" a small dialog box appears and we need to fillup the post title over there.
I have used firebug and has seen the form's action page, form input elements etc.
This is how the form looks like
<form id="new_page_dialog_form" target="image_upload_iframe" enctype="multipart/form-data" action="http://calendario.simcolombia.com/groups/informacingeneral/weblog-post" method="post">
<table>
<tr>
<td><input type="text" id="new_page_title" name="title" size="30"></td>
</tr>
<tr>
<td><input type="submit" id="new_page_dialog_ok" name="ok_button" value="Create"></tr>
</table>
</form>
I have removed the label tags as they are of no importance.
So I need to post to this page
http://calendario.simcolombia.com/groups/informacingeneral/weblog-post
with the input id "new_page_title". So I have tried this with curl requests. See my code so far.
$url = 'http://calendario.simcolombia.com/groups/informacingeneral/weblog-post';
// Login & get your cookie...
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
'submit' => 'new_page_dialog_ok' ,
'new_page_title' => 'Verizon'
)));
$output = curl_exec($ch);
echo $output;
And this is giving me an internal server error.
I am not that good at PHP so any help will be really appreciated