rewrite the counter in the $_SESSION array to a boolean array to only check if page was refreshed or not
/*[login to view URL]
This page displays a welcome message and the complete page
is refreshed every 60 seconds. Initially the text color is
black, but each refresh uses a randomly chosen text color
from red, green, blue or maroon. Because the color choice
is random, the same color may repeat after a refresh.
*/
session_start();
if (!isset($_SESSION['pageRefreshCount']))
$_SESSION['pageRefreshCount']=0;
?>
Welcome Message with Date, Time, and 60-Second Refresh
Welcome!
$greetingColor = "black";
if ($_SESSION['pageRefreshCount'] != 0)
{
$colorPicker = rand(1, 100);
if ($colorPicker > 75)
$greetingColor = "red";
else if ($colorPicker > 50)
$greetingColor = "green";
else if ($colorPicker > 25)
$greetingColor = "blue";
else
$greetingColor = "maroon";
}
$_SESSION['pageRefreshCount'] = $_SESSION['pageRefreshCount'] + 1;
echo "
$greetingColor
";
echo "
It's ".date("l, F jS").".
\r\n";
echo "The time is ".date("g:ia").".
\r\n";
echo "
Or at least that's our time, ".
"though it may not be yours.
\r\n";
?>
Pedagogical Note:
This page starts off using the
default text color of black to display all text. Then
the page refreshes
every 60 seconds, and each time it
does, everything (including this note) is displayed in
one of four
randomly chosen alternate colors (red, green,
blue or maroon) and the date and time are updated.
I have 3 year experience in wordpress and php platform. I had been completed many projects into this platform. Let me more dicuss into chat sir.
My $kype id = [login to view URL]
It is my poftfolio : [login to view URL]
[login to view URL]
[login to view URL]
[login to view URL]
[login to view URL]
Thanks
Hi
Regarding: Fixing the issue in php code , so that you can get the required results.
Please come to chat for more discussion.
Waiting for your positive response
With regards
CoderCrew
hello
sir i can give this work with 100% satisfaction within time limit,and also i have great hands on Php ,waiting for your message
Experience in PHP, PHP Frameworks Like Codeigniter, Yii 2 and laravel 5 and its customization.
Hello there,
I would like to be considered for this job as I have great experience in php development.
I will start it tomorrow morning and complete it in 1 hour.
so I can deliver in 10-12 hours from now.
Thanks.,
Ramesh