Jump to content

Search the Community

Showing results for tags 'show image by time php script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Can any body help me with the script below, i call it to a web page via Includes newtime.php and it should show a open or closed gif between the hours ive set for each day on that web page 11am - 3am open 3am - 11am Closed <?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. // MONDAY SCHEDULE if ($d == 1 && $h >= 11 && $h < 3) $img = 'open.gif'; else if ($d == 1 && $h >= 3 && $h < 11) $img = 'closed.gif'; else if ($d == 2 && $h < 11) $img = 'open.gif'; // TUESDAY SCHEDULE if ($d == 2 && $h >= 11 && $h < 3) $img = 'open.gif'; else if ($d == 2 && $h >= 3 && $h < 11) $img = 'closed.gif'; else if ($d == 3 && $h < 11) $img = 'open.gif'; // WEDNESDAY SCHEDULE if ($d == 3 && $h >= 11 && $h < 3) $img = 'open.gif'; else if ($d == 3 && $h >= 3 && $h < 11) $img = 'closed.gif'; else if ($d == 4 && $h < 11) $img = 'open.gif'; // THURSDAY SCHEDULE if ($d == 4 && $h >= 11 && $h < 3) $img = 'open.gif'; else if ($d == 4 && $h >= 3 && $h < 11) $img = 'closed.gif'; else if ($d == 5 && $h < 11) $img = 'open.gif'; // FRIDAY SCHEDULE if ($d == 5 && $h >= 11 && $h < 3) $img = 'open.gif'; else if ($d == 5 && $h >= 3 && $h < 11) $img = 'closed.gif'; else if ($d == 6 && $h < 11) $img = 'open.gif'; // SATURDAY SCHEDULE if ($d == 6 && $h >= 11 && $h < 3) $img = '/open.gif'; else if ($d == 6 && $h >= 3 && $h < 11) $img = '/closed.gif'; else if ($d == 7 && $h < 11) $img = '/open.gif'; // SUNDAY SCHEDULE if ($d == 7 && $h >= 11 && $h < 3) $img = '/open.gif'; else if ($d == 7 && $h >= 3 && $h < 11) $img = '/closed.gif'; else if ($d == 1 && $h < 11) $img = '/open.gif'; ?> <html> ... <body> ... <img src="<?php echo $img; ?>"> ... </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.