1. Home
  2. Computing & Technology
  3. PHP / MySQL

Automatic Copyright Dates
Automatically keep your copyright dates current on your website

By Angela Bradley, About.com

Most websites include a copyright disclaimer at the bottom of the page. Having a copyright line that is out of date can be a bad reflection on your site. This little PHP script automatically changes the copyright to the current year every year so that it never goes out of date.
<?php
$time = time () ;
//This line gets the current time off the server

$year= date("Y",$time) . "<br>";
//This line formats it to display just the year

echo "Copyright 2002 - " . $year;
//this line prints out the copyright date range, you need to edit 2002 to be your opening year
?>
This code could be placed directly on the page, or could be held in a separate file and called with a file include.
More PHP / MySQL Quick Tips
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. PHP Updating Copyright - Automatic Copyright Dates - PHP Copyright Year Script

©2009 About.com, a part of The New York Times Company.

All rights reserved.