Visa ett inlägg
Oläst 2011-10-03, 11:35 #19
JeZZifelt JeZZifelt är inte uppkopplad
Flitig postare
 
Reg.datum: Feb 2006
Inlägg: 326
JeZZifelt JeZZifelt är inte uppkopplad
Flitig postare
 
Reg.datum: Feb 2006
Inlägg: 326
Har modifierat till denna kod nu:
PHP-kod:
<?php 
$date 
getdate(); 
$hour $date['hours']; 
$day date('w'); 

if (
$day == && $hour >= 21 || $hour <=10) {header("Location: offline.php"); 
}elseif(
$day == && $hour >= 21 || $hour <=10) {header("Location: offline.php"); 
}elseif(
$day == && $hour >= 21 || $hour <=10) {header("Location: offline.php"); 
}elseif(
$day == && $hour >= 21 || $hour <=10) {header("Location: offline.php"); 
}elseif(
$day == && $hour >= 22 || $hour <=10) {header("Location: offline.php"); 
}elseif(
$day == && $hour >= 22 || $hour <=10) {header("Location: offline.php"); 
}elseif(
$day == && $hour >= 20 || $hour <=11) {header("Location: offline.php");
}else {
header("Location: online.php"); 
}  
?>
Funkar bra förutom en enda grej. Den verkar endast gå efter söndags-tiden. T.ex. nu på en måndag när klockan är över elva borde den vara online, men man kommer till offlinesidan. Ändrar jag så att även söndag är online efter 11 (ändrar till 10) så hamnar jag rätt på onlinesidan. Varför blir det så?
JeZZifelt är inte uppkopplad   Svara med citatSvara med citat