lundi 26 janvier 2015

PHP break not working

I am trying to disable a form on weekends. In my code I have a break after the variable $noaccess. When I run the code the form does not load. I am not sure what is going on please help. Here is my code:



$wkday = date('D');
if ($wkday == "Sun") {
$noaccess = "yes";
break;
} elseif ($currday == "Sat") {
$noaccess = "yes";
} else {
$noaccess = "no";
}


Here is the code for displaying the form:



if ($noaccess == "yes") {
echo "You cannot access this area now";
} else {
//Form displays normally
}

Aucun commentaire:

Enregistrer un commentaire