<?php ob_start(); ?>

 <?php 
include("connection.php");


 //this makes the time in the past to destroy the cookie 

$aa=$_COOKIE['md'];
 $bb=$_COOKIE['li'];
$h1=$_COOKIE['h'];
$m1=$_COOKIE['m'];
date_default_timezone_set('GMT');

if (date_default_timezone_get()) {
     'date_default_timezone_set: ' . date_default_timezone_get() . '<br />';

     date("l, F d, Y h:i" ,time()) .'<br />';
    $date_str = date("l, F d, Y h:i" ,time()); //ex:from database

$date = new DateTime($date_str,new DateTimeZone('GMT'));
$date->setTimezone(new DateTimeZone('Etc/GMT+5'));
 "$bb.<br>";
 $x=$date->format('H:i:s'); //testing
 $x;
$v1=4;
$v2=67;
$v3=$v2-$v1;
 $h2=$date->format('H:'); //testing
 $m2=$date->format('i');
 "<br>$v3";
$h3=$h2-$h1;
$m3=$m2-$m1;
$s=$h3.":".$m3;
 $s;
 "time spend is".$spend=$s;
}
 "this is orignal".$h1.$m1."<br>";
if (ini_get('date.timezone')) {
 'date.timezone: ' . ini_get('date.timezone');
}
$conform=mysql_query("UPDATE user_ts SET user_ts_ulo='$x',user_st='$spend' where user_ts_umd='$aa' ");
if($conform)
{
     $past = time() - 100; 
 setcookie(ID_my_site, gone, $past); 

 setcookie(Key_my_site, gone, $past); 

 header("Location: index.php"); 


}
else
{

}
 ?> 
<?php ob_flush(); ?>

What's your error ? (Please use code tags)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.