I’m setting up a custom blog that grabs the posts from a mysql database. Everything is working great, but what I’m wondering is how I should go about adding posts to the database. I can only think of creating a random page that needs password access with a textarea and submit button, or just adding it in PHPMyAdmin. Neither of those two methods seems very practical, though.
How does Jeff Atwood himself do it? How should I do it?
edit: For clarification, this is not a blog system, this is a website I’m working on for myself.
Well firstly instead of a textarea I would use CK editor (or your favourite replacement) unless you’re happy to enter the HTML yourself. Since you’re the only person using the site this is probably the case.
Securing the form can be very simple or very elaborate. As you say it’s just for yourself and not for anybody else I would suggest putting it into a folder (not named admin) and using .htaccess as basic user authentication. This is really easy and fast to set up. Here’s the top Google Result for online tools.
The reason I’m suggesting this solution is that it will take only a few minutes to set up. It’s not 100% secure, but otherwise you would need coding effort to create signon pages and session handling etc. I guess you could even have a password field on the input form itself and check this in your processing logic. Sort of like a failback on the .htaccess that would prevent action from being taken on submitted forms unless the correct password is entered. Somebody could penetrate .htaccess and view the form, but not use it.
I’m pretty sure the major bloggers have got admin backends that they login to in order to be able to post. Almost certainly they have access control levels to assign roles to specific users. All of this is probably overkill for a simple site where this feature is not the main function of the site but rather a side attraction.
If it is a big part of the site you could do an installation of an existing CMS (WordPress,Joomla, Drupal) in a subdirectory and then get your content feeder to pull from the CMS database. That’s a pretty big footprint but then at least you’ll have all the features of the CMS at your disposal. It’s also pretty impractical and seems wasteful to have an entire CMS to provide snippets.
What specifically is not practical about a form? Are you thinking more along the lines of polling an RSS feed for content? If you’re wanting your own content to appear you’re going to have to enter it somewhere. I can’t think of a way to do it more easily than with a form.