I just wanted to share a couple of simple tips that may help out some of those who are new to developing sites using .php
One of the best tips I think is to use includes as often as you can. I always use an include for my main navigation menu and footer, and sometimes for my header, too... This allows you to make updates easily in one place, and saves a lot of time. It also reduces the chances of making a mistake and having conflicting information on your site...
A basic include in php looks like this:
Code:
<?
include("menu.php");
?> Another thing you see a lot is a footer that has a copyright and a date, usually just the year, and it is out of date... Here is an easy way to avoid that problem:
Code:
<?php
$today = date("Y");
?>
Copyright © <?=$today?> My Website. Anyway, these are just a couple of simple tips I thought I would share...