The title is suppose to say date function.
As part of a project, I am trying to create a website that displays details of a football teams away fixtures. I have put dates of the fixtures into variables and would like to display the upcoming game.
However, It seems to only check todays date against the fixtures 'day' rather than day - month - year. This means it either loads up the wrong page or does not load any page at all.
I've put the code which i have already, does anyone know what i am doing wrong?
list($check,$data) = validate ($dbc,$_POST['email'],$_POST['pass']);
if ($check)
{
session_start();
$_SESSION[ 'user_id' ] = $data[ 'user_id' ];
$_SESSION[ 'first_name' ] = $data[ 'first_name' ];
$_SESSION[ 'last_name' ] = $data[ 'last_name' ];
$_SESSION[ 'team' ] = $data[ 'team' ];
$_SESSION[ 'email' ] = $data[ 'email' ];
if (($_SESSION['team']) == 'BR' )
{
date_default_timezone_set('UTC');
$fixture = date('d-m-Y');
$fixture=date('d-m-Y', strtotime($fixture));;
$bury = date('d-m-Y', strtotime("15-02-2014"));
$scunthorpe = date('d-m-Y', strtotime("25-02-2014"));
$northampton = date('d-m-Y', strtotime("01-03-2014"));
$hartlepool = date('d-m-Y', strtotime("15-03-2014"));
$fleetwood = date('d-m-Y', strtotime("25-03-2014"));
$wimbledon = date('d-m-Y', strtotime("29-04-2014"));
$portsmouth = date('d-m-Y', strtotime("19-04-2014"));
$wycombe = date('d-m-Y', strtotime("28-04-2014"));
if ($fixture <= $bury) {load ('teams/bury.php');}
elseif ($fixture <= $scunthorpe) {load ('teams/scunthorpe.php');}
elseif ($fixture <= $northampton){load ('teams/northampton.php');}
elseif ($fixture <= $hartlepool) {load ('teams/hartlepool.php');}
elseif ($fixture <= $fleetwood) {load ('teams/fleetwood.php');}
elseif ($fixture <= $wimbledon) {load ('teams/wimbledon.php');}
elseif ($fixture <= $portsmouth) {load ('teams/portsmouth.php');}
elseif ($fixture <= $wycome) {load ('teams/portsmouth.php');}
{echo "No remaining fixtures left for season 2013/2014";}
}
else
{
date_default_timezone_set('UTC');
$fixture = date('d-m-Y');
$fixture=date('d-m-Y', strtotime($fixture));;
$orient = date ('d m Y', strtotime("11-02-2014"));
$sheffutd = date ('d m Y', strtotime("22-02-2014"));
$shrewsbury = date ('d m Y', strtotime("08-03-2014"));
$peterborough = date ('d m Y', strtotime("11-03-2014"));
$colchester = date ('d m Y', strtotime("22-03-2014"));
$rotherham = date ('d m Y', strtotime("29-03-2014"));
$walsall = date ('d m Y', strtotime("12-04-2014"));
$stevenage = date ('d m Y', strtotime("21-04-2014"));
$crawley = date ('d m Y', strtotime("03-05-2014"));
if ($fixture <= $orient) {load ('teams/orient.html');}
elseif ($fixture <= $sheffutd) {load ('teams/sheffutd.php');}
elseif ($fixture <= $shrewsbury) {load ('teams/shrewsbury.php');}
elseif ($fixture <= $peterborough) {load ('teams/peterbrough.php');}
elseif ($fixture <= $colchester) {load ('teams/colchester.php');}
elseif ($fixture <= $rotherham) {load ('teams/rotherham.php');}
elseif ($fixture <= $walsall) {load ('teams/walsall.php');}
elseif ($fixture <= $stevenage) {load ('teams/stevenage.php');}
elseif ($fixture <= $crawley) {load ('teams/crawley.php');}
else
{echo "No remaining fixtures left for season 2013/2014";}
}
}