Form submit to blog post? How would I do this?

efeezy

New member
Oct 5, 2007
5,250
136
0
50
I use a Wordpress plugin called C Forms. Some of you may use it or have heard of it. Anyway, it's pretty flexible as far as where you can send the information that's completed in the forms you create. It will let you create simple contact forms, with dropdown menus etc. If I were to have a form that was sent to a database, what would need to be done to take that information and turn it into a blog post on my site with say a Title, Content, Image etc. How possible is this, and what would type of programming would be involved. Keep in mind, I'm not a programmer, but I'm pretty interested in trying to make something like this work.
 


^^ Holy shit that's fucking genius. Sometimes it's the easy fixes that are the hardest ones to find.

I'll mess around with it and see how it works. Thanks. +rep.

If anyone has other ideas, I'd still be interested.
 
I use the XML-RPC protocol in wordpress to do this. I used to do the email submit, but I got bitched at by my hosting company for sending massive amounts of email. It is actually pretty easy to implement with php. Here is a php function to fit the bill:
[high=php]
function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords,$encoding='UTF-8') {
$title = htmlentities($title,ENT_NOQUOTES,$encoding);
$keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);

$content = array(
'title'=>$title,
'description'=>$body,
'mt_allow_comments'=>1, // 1 to allow comments
'mt_allow_pings'=>1, // 1 to allow trackbacks
'post_type'=>'post',
'mt_keywords'=>array($keywords),
'categories'=>array($category)
);
$params = array(0,$username,$password,$content,true);
$request = xmlrpc_encode_request('metaWeblog.newPost',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
$results = curl_exec($ch);
curl_close($ch);
return $results;
}
[/high]
Can't remember where i got this function, but I'm pretty sure didn't write it
$rpcurl should be $rpcurl='http://yourblog.com/xmlrpc.php';
Make sure you turn on the xmlrpc option in WP
If you wanna go this route and need help pm me