Click to See Complete Forum and Search --> : PHP driven website


amazing_andr3
01-10-2005, 04:38 PM
I'd like to set up my first PHP-driven website, and I was wondering if you guys know of a comprehensive resource where I can learn how to properly do that (with or without MySQL). I have googled a couple of interesting articles but they don't seem to cover everything.

I was also wondering if you recommend putting the menu, footer, ads column (etc) of any website, no matter how small or rarely updated, in separate PHP files.

TechEvangelist
01-10-2005, 05:22 PM
If you do a search for "PHP tutorial" you will find thousands of beginner tutorials. If you are searching in Google, put the quotes around the words and it will narrow the results down to sites that use that exact phrase in the content of the page.

Here are a couple of good places to start. If you really want something comprehensive, you should probably buy a good book on PHP and MYSQL.

http://www.w3schools.com/php/default.asp

http://webmonkey.wired.com/webmonkey/programming/php/tutorials/tutorial4.html

Whether or not you separate the header, footer, ad columns, etc, depends upon how you want to design your site. You have a lot of flexibility with a dynamic site. Separate header and footer include files allow you to update a single file for each, which updates the entire site. Its common to set up multiple advertising blocks as separate files so that you can choose which one to display on a page, or you can just include the block of code in a database column. My preference is for the external files, because once again you can modify one file that affects every page using it.

The general rule is to not go overboard with include or require statements, because each takes a fraction of a second to process. If you are on a slow or overloaded server, you will start to see performance problems if you include too many external files.