Dynamic pages Howto question
Moderator: General Moderators
Dynamic pages Howto question
Just getting started with all this and was wondering what the common practice is when it comes to building pages with say, templates and dynamic content. Would you do something like design your dynamic page layout in an IDE like Dreamweaver, and the store that HTML as BLOBS in a database? or would you save the HTML in a file and store the path to that file in the database, then reading that file with code to build the page? I would imagine that you could do it both ways, and that storing the HTML in the DB would take a little longer to retrieve, but I do not know the most practiced way. Thanks in advance.
- trollll
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 10, 2003 11:56 pm
- Location: Round Rock, TX
- Contact:
I think it depends most on the hosting situation (do you have a db?), available development time and personal preference. Some people would really rather have static html files that they can have php parse through and insert content into them. Others would rather have html chunks stored in the database. For myself, I prefer not to store the html code in the database, unless I need to make a system for non-technical people (or even non-designers) to edit the layout. I try to keep those occurances to a minimum, though...
The way I work is to create the whole page as HTML and put text/graphics etc into the parts which will finally be handled by PHP. Doing that will let you see the results and make changes before you start coding the PHP stuff.
When I'm happy with the page layout I will then start adding the PHP code.
Remember that PHP won't run directly off your computer like standard HTML does. You will either need to keep uploading the pages to a server to make sure the PHP is running ok, or install Apache on your computer.
Either way you will need to be on-line for PHP to work.
...and I never store HTML in a database simply because I have found no reason to do that yet.
When I'm happy with the page layout I will then start adding the PHP code.
Remember that PHP won't run directly off your computer like standard HTML does. You will either need to keep uploading the pages to a server to make sure the PHP is running ok, or install Apache on your computer.
Either way you will need to be on-line for PHP to work.
...and I never store HTML in a database simply because I have found no reason to do that yet.
Thanks for the insight. I have the hosting and the DB and I've been playing around with the language. It really is an amazing combination of tools. I am weak however in the HTML department. I can layout pages all day long in Dreamweaver, I just can't look at the code and spot the close tag of a table at the bottom of the source. In time things will get better. Thanks again!