Lesson 2

Hello, Chuck is back.

Today is Friday, April 26, 2024 and I am presenting Lesson 2 for the LVS Online PHP learning course.

First, let's check to see which browser you are using.

Your browser is unknown to me.

Hmmm, have you thought of using something else?


This has been a challenging lesson.   I finally got the styles to switch between four, the original and three others.   The method I used is contained in the following code which is inside the "header.inc.php" file.   Refreshing the page every five minutes will give you a different look.   I originally had in 15 minute increments as there are 4 style sheets.   Hence, the variable “$qtr” but this was too long a wait.

<link href='assets/styles/styles-rev.css' rel='stylesheet' type='text/css' />
<?php
$minute=date('i');
if($minute>="05" && $minute<="09" || $minute>="25" && $minute<="29" || $minute>="45" && $minute<="49") $qtr='1';
else if($minute>="10" && $minute<="14" || $minute>="30" && $minute<="34" || $minute>="50" && $minute<="54") $qtr='2';
else if($minute>="15" && $minute<="19" || $minute>="35" && $minute<="39" || $minute>="55" && $minute<="59") $qtr='3';
switch($qtr) {
case '1':
$styles="<link href='assets/styles/styles-2.css' rel='stylesheet' type='text/css' />";
break;
case '2':
$styles="<link href='assets/styles/styles3.css' rel='stylesheet' type='text/css' />";
break;
case '3':
$styles="<link href='assets/styles/styles4.css' rel='stylesheet' type='text/css' />";
break;
/* default:
$styles="<link href='assets/styles/styles-rev.css' rel='stylesheet' type='text/css' />";
break; */
}
echo $styles;
?>


If you are so interested, I am preparing a newsletter to be sent out on a monthly basis.   If you would like to receive this bit of information, please provide your email address in the space below.

Newsletter Signup


My Homepage — Imaging and Art