CAN someone please help me with a web code that will display an image based on the time of the day and the week of the day. Example today is monday an image will display from 8:00am to 9am and so on! Please i really need help with this. Thank you in advance
Please keep this discussion going in your current topics.
Can someone help me fix this code? I am trying to change images on my webpage base on time and day of the week. For example lets say today is monday i want an image to display from 9am to 12 pm and tuesday and so on. Please help
<html>
<body>
<script type="text/javascript">
var day = new Date();
var today = day.getDay();
var hour = day.getHours();
var minutes = day.getMinutes();
if (today>0 && today<6)
{if (hour = 8)
{if (minutes > 23)
{document.write("<img src="image2.jpg">")}
…
and
Can someone tell me how can i run this php code in html? I am trying to display an image based on time of the day and week of the day.
<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-2;
// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < …
1 Like