2011年10月6日星期四

PHPMaster.com: Creating a Mobile Photo Blog, Part 1


PHPMaster.com has started up a new series of tutorials today with part one of "Creating a Mobile Photo Blog". The set of tutorials will show you how to create a simple blogging tool that will upload images as submitted via an email address.



This is the first article in a two-part series in which I will show you how to create a photo blog as part of your personal website which you can update from your phone simply by sending an email. You'll write a script to check the inbox of an email account for new messages using POP3; the script will extract the messages' subject line, body text, and attachments and update a database accordingly. You can then pull the information from the database for display on your blog, in a sidebar, or however else you see fit.


The start with some of the security considerations you'll need to keep in mind when creating a script like this depending on how open you want it to be (like filtering based on the "From" email or sending an approval message before posting). Included in the post is the SQL to create their basic tables for posts, image details and the pending items. There's also a PHP class (POP3) that makes an IMAP connection to a remote server, authenticates as your account and fetches the latest messages along with their attachments. These are pulled with a quick script and displayed via a foreach.



Part two will get into more of the integration of the images and the approval technique prior to posting the images.

没有评论:

发表评论