Shopping Cart Forum

Go Back   eShop Forums - eCommerce Help Forum for Shopping Cart Owners. > Tech Corner > PHP/MySQL ASP.net and other server side technologies
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
PHP/MySQL ASP.net and other server side technologies Everything to do with the programming of websites. Discuss what goes on under the bonnet of your ecart or just chat about programming in general.

15% discount
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 14-10-2007, 05:49 AM
Lawrence Lawrence is online now
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,154
Thanks: 0
Thanked 69 Times in 69 Posts
Default How to create an auto updating copyright date using PHP.

This is a very simple script to automatically update your copyright notification every Jan 1st. It uses PHP's versatile date() function to extract the year from the current date then print it to the user's browser.

This example is very simplified. In a real world situation you would probably include some HTML in the echo statement to format the output to the browser.
PHP Code:
<?php
$year 
date("Y");
echo 
"Copyright &copy; $year";
?>
The is another way to achieve the same result. Depending on how the rest of the page is structured, this may be a more appropriate method.
PHP Code:
<p>Copyright &copy; <?php echo date("Y"); ?></p>
The advantage of the second method is that if you are using a WYSIWYG editor e.g. Dreamweaver to edit the page, you have something to work with in design view. With the first method nothing will show in design view, everything will have to be coded by hand.
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Brand Keywords Create Your Long-term Sustainable Profit Margin SEOBook SEO and PPC 0 29-09-2007 08:25 PM
How to change the date format in Zen from US to UK. Lawrence Zen Cart 0 15-08-2007 01:22 AM

Google

Edible Graphics, Affordable E-Commerce, Web Shops & Custom Form Scripts
Click here for domain name registration and web hosting
tech news, product reviews, the latest home and business technology, the latest in digital imaging


Content Relevant URLs by vBSEO 3.0.0