Although it sounds fancy, Blog Post Creator is just a webpage that shows a form where the user can type in the text of his/her article, and then save it by submitting the form:
1. Open up your text editor. Put the following code in a new file:
<?php $action = (!empty($_POST['btn_submit']) && ($_POST['btn_submit'] === 'Save')) ? 'save_article' : 'show_form'; switch($action){ case 'save_article': try { $connection = new Mongo(); $database = $connection->selectDB('myblogsite'); $collection = $database-> selectCollection('articles'); $article = array{ 'title' => $_POST['title'], 'content' => $_POST['content'], 'saved_at' => new MongoDate() }; $collection->insert($article); } catch(MongoConnectionException $e) { die("Failed to connect to database ". $e->getMessage()); } catch(MongoException $e) { die('Failed to insert data '.$e->getMessage()); } break; case 'show_form': default: } ?> <!DOCTYPE html PUBLIC...