Archive for the ‘PHP’ Category

6 PHP Session Tutorials

Six PHP Session Tutorials to help when using sessions:

  1. PHP session tutorial – a clear basic introduction from PHP F1
  2. Managing Users with PHP Sessions and MySQL - building a logging in system from Sitepoint
  3. Basic PHP Session – from about.com
  4. Using Sessions in PHP – building a membership system
  5. Session Control and Cookies
  6. Sessions and cookies: Adding state to a stateless protocol – at PHP Freaks

Printing the Date in PHP

To print the date in the following format:

2008-06-27 use:

<?php echo date("Y-m-d"); ?>

This is useful for automatically updating the date in the copyright section of a web page:

Copyright © <?php echo date("Y"); ?> Painted Pixels.

Once this is in place on a web page, the year will be adjusted saving yourself the job of having to do it manually.

For other date formats see the PHP Manual.