Jump to content

ANY HELP PLEASE


adamriley

Recommended Posts

can someone tell me why this is not working      the time is 18.20

 

What i expect it to do is header to the open page but it does not (notopen.php)

 

index.php

<?php

if ( Date(G) >= 16 && Date(G) <= 20 ) { 
$reason = "Unknown";
} else {
$reason = "Interact is not open it opens at 4.pm and closes at 8 pm";
}



if ( $reason = "Interact is not open it opens at 4.pm and closes at 8 pm" ) { 
// interact not open
header('Location: http://interact/Basic/Notopen.php?reason=closed');

} else { 
// interact is open
header('Location: http://interact/Basic/open.php');

}
?>

 

Link to comment
https://forums.phpfreaks.com/topic/199695-any-help-please/
Share on other sites

This might be easier. It's definitely more compact.

 

<?php

date_default_timezone_set('America/Chicago'); // Change to correct time zone for your area.

if ( date(G) >= 16 && date(G) <= 20 ) { 
     header('Location: http://interact/Basic/open.php');
     exit();
} else {
     header('Location: http://interact/Basic/Notopen.php?reason=closed');
     exit();
}
?>

Link to comment
https://forums.phpfreaks.com/topic/199695-any-help-please/#findComment-1048232
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.