I would really appreciate some advice: I have to update my ancient html - change one page at a time- humor site. A buddy is offering to convert it php-- not changing the file extensions, just doing that .htaccess file thing that lets php work with .html pages. And he'll set up msql databases holding the content files for each page. He says it's very secure the way he does it. I just don't have the knowledge to know if that's the way to go. I definitely will not be converting the site to Jooma or WordPress for reasons not worth going into... And updating 200 pages one at a time isn't really so enjoyable... Does his approach sound good, assuming he does it well? thanks!
PHP stands for Hypertext Pre-processor, a server side language script intended to perform dynamic requests. A single line into .htaccess can do the trick to make your .htm or whatever other extension work like php so it is useful even if you do no use mysql. There is a ton of scripts that work with flat text database or no database at all. In fact you can simply add a counter or any other bit of php scripting into your html page to make the change worth.
How is holding the data in a database going to be any different to having the files exactly ? There are advantages to using mysql ( sql ) to store data, but there are also disadvantages, if you write articles and never touch them again then having the same exact content retrieved from a mysql database will just make your site have to do more work.
Yes krakjoe is write, if you just want to update navigation part etc then you can use some template engine or other templating technique, their is no need to move your contents to mysql from files.
Thanks for the thoughts. So how would that work, if each of the 200 pages has a few paragraphs of unique content, but they aren't in a database, then you mean each 200 pages would be permanent. So if I wanted to change the layout, I would have to do it one page at a time, right? if not, where is that unique info for each page sitting? Thanks.
You should use php includes to build your template I think, just make a single header, footer and navigation file, and include these files in your pages. Since only one file is included on every page, so effect on header, footer or navigation will be visible throughout the site.
Yeah exactly, make everything styled with css, and build a base template, then you can just edit each article as text and include it in a preformatted div
Yes they'll be secure as common code such as banner, adsense, menu can be put in the .htaccess file & viewers wont be able to view the code.
I have a video/jokes site that is PHP but just "flat files" (no database). The look and feel of each page is determined by a template that I pull in, using includes, and the content is just the standard HTML, and then an included footer. To change the layout, I edit the included files, and leave the main content alone. I have other sites that are all MySQL database driven using CMS (Content Management Systems) or blogging s/w such as WordPress. Frankly both techniques are easy, but I prefer to use the included file method as it will be easier on the server, and is easier most of the time to update. I just write my article with a couple of included lines for the template and the jobs done. I'm pretty much always in a shell session to the server so editing the files themselves is easy for me, (and I have no need to upload after with FTP).You may prefer the convenience of an CMS/blog admin panel and avoid writing HTML and them uploading. There's no need to put your site as I understand into a database, but what you would have there, in the long term, is something you easily export and sell on to others as people looking for content will be more willing to buy SQL than a bunch of text files. Furthermore, if the database is created properly it could have it's own session management for seeing what users visit which pages and maintain your own lives logs, but that sounds like overkill for a 200 page site. So, you could go either way - flat file or database - it's what is more convenient for you to update and add to that's the important thing here. kr, LiamVictor
Great answers! Thanks everyone. I don't have enough of a grasp of the database approach to assess it. It's just clear to update into using includes, etc. It sounds like both could work, and each has some advantages... You think the database approach would load slower or be a problem with 6000 and growing visitors a day? (I guess that depends on my hosting plan).
6000 visitors will be stress no matter if they are included or retrieved from a database, a properly balanaced network will manage either one with ease. A big advantage to keeping your stuff in a database would be accessibility, it's not so hard to have one of these javascript wysiwyg editors to edit your content and it would be never logging into ftp again, plus once you split out all your content into includes and dynamic sources you'll notice the style of the page goes away ( while editing only ), so it's hard to make every single page uniform; as time goes by you forget which tags to use for what, but if you're wysiwyg is inplace in the middle of the page with the style sheet attached then you'll see what visitors see......