Looking for help in making code for an index.php file that redirects to another page if the date is past a certain date.
Not quite sure how to do this. It’s been years since I did php.
This is what I have, but it’s not working.
<? php
var date = new Date()
.toISOString()
.split('T')[0];
if(date >= "2018-09-24"){
window.location.href = "http://google.com";
}
?>
This is the error:
Parse error : syntax error, unexpected ‘var’ (T_VAR) in /home4/dollar08/public_html/davemonroe/index.php on line 15