500 error problem

Hi,
i am new to php and i am creating a website which should show different content at different times (hours and minutes). Whenever the website has the script in it shows a 500 error. Could you tell me whats wrong with it.

[php]<?php
$time = date(‘H,i’);

if($time < 8,35){
include(‘content/0.html’);
}else if($time >= 8,35 and $time < 9,35){
include(‘content/1.html’);
}else if($time >= 9,35 and $time < 10,35){
include(‘content/2.html’);
}else if($time >= 10,35 and $time < 10,55){
include(‘content/3.html’);
}else if($time >= 10,55 and $time < 11,10){
include(‘content/4.html’);
}else if($time >= 11,10 and $time < 11,25){
include(‘content/5.html’);
}else if($time >= 11,25 and $time < 12,20){
include(‘content/6.html’);
}else if($time >= 12,20 and $time < 13,15){
include(‘content/7.html’);
}else if($time >= 13,15 and $time < 13,50){
include(‘content/8.html’);
}else if($time >= 13,50 and $time < 15,00){
include(‘content/9.html’);
}else{
include(‘content/0.html’);
}
?>[/php]

Hi there,

Wherever you’re referencing the time, surround it with quotes " or ’
[php]if($time < ‘8,35’){
include(‘content/0.html’);
}else if($time >= ‘8,35’ and $time < ‘9,35’){
include(‘content/1.html’);
}els…
[/php]

Awsome! Thanks so much! It works now! :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service