Jump to content

Header redirect


gum1982

Recommended Posts

 

Can someone please tell me why my header redirect isnt working.

 

The field created_at is just pulling a field out off the database i haven't added this code.

 

If i put echo "expired"; instead off the header redirect that outputs fine :confused:

 

$exp_date = $field['created_at'];
echo "Database ".$exp_date.'<br />';

$todays_date = date("Y-m-j H:i:s");
echo "Today ".$todays_date.'<br />';

$expiration_date = strtotime($exp_date);
echo "Database ".$expiration_date.'<br />';

$today = strtotime($todays_date);
echo "Today ".$today.'<br />';



if ($expiration_date > $today) {
     echo "Welcome";
} else {
     header("Location: http://www.example.com/"); 
exit;
}

 

Link to comment
https://forums.phpfreaks.com/topic/183028-header-redirect/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.