View Single Post
Old 02-29-2008, 09:02 AM   #1 (permalink)
elivate
Platinum Lifetime Member
 
Name: Peter
Last Online: Yesterday 08:06 PM
iTrader: (22)
Join Date: Aug 2005
Posts: 1,165
DNF$: 0
Location: Canada
Country:


Some basic php tips...

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...
__________________
have a nice day
elivate is offline   Reply With Quote