PHP Classes

File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch06_Dates/strvrfy.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch06_Dates/strvrfy.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch06_Dates/strvrfy.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 3 months ago
Size: 447 bytes
 

Contents

Class file image Download
<?php
$user_supplied_date
= $_GET['date'];
$user_timestamp = strtotime($user_supplied_date);

// beginning/end of valid date range
$start_date = strtotime('2006-01-01');
$end_date = strtotime('2007-01-01');


if (
$user_timestamp < $start_date ||
   
$user_timestamp >= $end_date) {
    die(
'Date does not fall within the valid range of dates');
}

$database_date = date('Y-m-d', $user_timestamp);
// Now use $database_date in a database query

?>

For more information send a message to info at phpclasses dot org.