Database vs. Manual-Entry for a Blog?

iMasterWeb

macrumors regular
Original poster
Mar 15, 2009
158
0
Hi! I'm in the process of designing/developing my first blog that's not made with iWeb. I'm at the point of starting some of the back-end work, and I have a question:

For the actual content (not the comments, user log-in, etc.) is it better/faster/more secure to manually type the post into the HTML file, or to store the information in a database?

It seems like it'd be a lot easier to format, add images, etc. on a post that I manually write into the page, however I could be wrong. The HTML method would also allow for cleaner URL's. So am I missing something, or would it really be easier to just manually enter posts? Thanks for the advice!

-iMaster
 

kate-willbury

macrumors 6502a
Feb 14, 2009
684
0
ummm what???

i highly doubt anyone out there still uses actual .html files to write their blogs with. most are powered via a CMS of some sort.

why would html files allow for 'cleaner' urls??? any decent cms will allow you to set up your url scheme in a plethora of ways.
 

jaikob

macrumors 6502
Jul 1, 2008
429
0
Freeland, MI
It really doesn't matter which way. I would assume you would use a database. It just makes things easier. You need programming experience in PHP, ASPNET, etc though.

You could for instance, type your HTML for your blog post, and paste it into a new blog record in your database.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
A number of blog software, including WordPress, allow you to enter the post as HTML code. A DB makes more sense long-term as dealing with flat files can become problematic as they add up. It would also make it harder to migrate to another blogging system.
 

iMasterWeb

macrumors regular
Original poster
Mar 15, 2009
158
0
Ok, for clarification: I am not using Wordpress, I'm attempting to do this by hand.

Also, if my database is hosted on my current web host, are you saying that its possible to transfer that information to a different web-host, or even a blogging platform if need be?

Right now, I'm leaning towards just entering them manually, because each page may be a little different in terms of formatting. Hmmmmm, just thought of something: Would I HAVE to do it in a DB to keep the comments organized and on their respective posts, or not necessarily?

Maybe Wordpress is the way to go...I'm sure its easier than this, but then again, I'm learning so much doing it the hard way...
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
Also, if my database is hosted on my current web host, are you saying that its possible to transfer that information to a different web-host, or even a blogging platform if need be?
Yes, it is possible to move DB content from one host to another. You would simply export the data and transfer it. If you're using the same blog software on the new host it's a simple file transfer and a couple commands to be back in business, but moving to a different blogging software can take a bit of tinkering to get DB tables into the format they need to be. Some people create scripts to do this automatically for popular software packages.

Right now, I'm leaning towards just entering them manually, because each page may be a little different in terms of formatting. Hmmmmm, just thought of something: Would I HAVE to do it in a DB to keep the comments organized and on their respective posts, or not necessarily?

Maybe Wordpress is the way to go...I'm sure its easier than this, but then again, I'm learning so much doing it the hard way...
You can do flat file blog posts and comments separately, but it can be a bit cumbersome. Essentially in the DB you would need to keep track of a post in some way (like the file name) even if it doesn't keep track of the content. Then the comments would be matched up with that.

I get wanting to learn this stuff on your own. I'm the same way, but it'll take you years to get the functionality and security of web apps like WordPress. Also, you have to worry a lot more about security when developing on your own. There's a lot of people creating web apps with no security forethought and they end up paying for it eventually.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
How do you even have comments without a database? Having something that allows a user to write directly to your page's core code is a disaster waiting to happen, and is idiotic.
I believe he meant having the comments in a DB, while the blog post was in a HTML file. Even if that's not the case, he wouldn't need to have the comments ending up in the core code. The comments could be stored in a flat file or XML and would be processed in a similar fashion as it would if it were going into a DB. It wouldn't really be less secure.
 

iMasterWeb

macrumors regular
Original poster
Mar 15, 2009
158
0
How do you even have comments without a database? Having something that allows a user to write directly to your page's core code is a disaster waiting to happen, and is idiotic.
I know I'm going to have to use a database for the comments, I'm just not sure if I wanted to use a database for the post itself.

I'll google around for some tips on security..and I'm thinking about buying a book about PHP and MySQl to learn from. Any suggestions?

(P.S. Angelwatt, you ARE an angel! :D)
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
and I'm thinking about buying a book about PHP and MySQl to learn from. Any suggestions?
I'm currently writing a PHP security page and below are some of the books I've found to be pretty good. The first one is short and really does just cover the bare essentials for security.
  • Essential PHP Security (2005, Chris Shiflett)
  • Securing PHP Web Applications (2008, Tricia Ballad and William Ballad)
  • php|architect's Guide to PHP Security (2005, Ilia Alshanetsky and Rasmus Lerdorf)
  • The Web Application Hacker's Handbook: Discovering and Exploiting Security Flaws (2007, Dafydd Stuttard and Marcus Pinto)
 

iMasterWeb

macrumors regular
Original poster
Mar 15, 2009
158
0
Awesome, thanks for the suggestions! I found a few pages as well. What I was really looking for, however, are some General PHP/MySQL books, kinda of like learning the language and practical usage examples, not just security. Also, be sure to link to that page you're writing once you're done with it as I'll surely take a look. Thanks for all your help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.