473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Load Set of Files Between Hrs

I have a set of file that I would like to use between the hours of 7am - 9pm, and then another set from 9pm - 7am. Am I on the right track with this code?

Thanks for any help....


[php]
<?php
$h = date('h');
if ($h < 09)
{
$link1 = 'caddisplay1.php';
$link2 = 'units1.php';
$link3 = 'emsa1.php';
}
else
{
$link1 = 'caddisplay.php';
$link2 = 'units.php';
$link3 = 'emsa.php';
}



echo "
<frameset rows=\"32,*\" style=\"border: 0;\" framespacing=\"0\">
<frame name=\"toolframe\" src=\"toolBar1.php\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"no\" noresize>

<frameset id=\"layout\" rows=\"60%,26,*\" cols=\"*\" border=\"3\" framespacing=\"3\">
<frame name=\"calls\" src=\"$link1\" scrolling=\"yes\" frameborder=\"yes\">
<frame name=\"middle\" src=\"$link3\" scrolling=\"no\" noresize frameborder=\"no\">
<frame name=\"units\" src=\"$link2\" scrolling=\"yes\" frameborder=\"yes\">
</frameset>
</frameset>
</frameset>
</HTML>
";
?>
[/php]
Aug 12 '08 #1
7 1419
r035198x
13,262 8TB
date('h') gives 12 hour format 01 - 12. You should use date('H') which gives 24 hour format 00 - 23.
Aug 12 '08 #2
i did have that and i had it set for 21 which is 9p, but it never switched..
Aug 12 '08 #3
r035198x
13,262 8TB
i did have that and i had it set for 21 which is 9p, but it never switched..
You'll need to have the page auto refreshing as well. Remember that script is run once before the page is displayed.
Aug 12 '08 #4
well I am not worried about the page refreshing, but maily for peopel who chose that link it will pull the correct files after the posted time..
Aug 12 '08 #5
r035198x
13,262 8TB
well I am not worried about the page refreshing, but maily for peopel who chose that link it will pull the correct files after the posted time..
People who click that link will go to the link that was set when the page first loaded. Remember (like I said above) that the PHP file will run only once before the page is displayed.
Aug 12 '08 #6
I understand that.. but the link to this index file is on a static page elsewhere, once click it will bring you to this page.. that is whay I am referring to..
Aug 12 '08 #7
r035198x
13,262 8TB
I understand that.. but the link to this index file is on a static page elsewhere, once click it will bring you to this page.. that is whay I am referring to..
Declare the $link variables before the if-else part.
Aug 12 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Nancy | last post by:
Hi, When I start my PC(winXP Pro), it always says: Unknown(): Unable toload dynamic library './php_msql.dll' - The specified module could not be found. Then my Apache servre starts, load php...
1
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
1
by: jen_designs | last post by:
Can you load 2 xml files on an html page via javascript? I can get one xml file to load, using the following code. How about two. I need to combine 2 xmls files on the client. Any other way to...
2
by: John Alesse | last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form It takes IE 12...
10
by: GeekBoy | last post by:
Okay, I have two identical web servers running Windows 2003 web server. I have an ASP.NET application which runs great on one of them. Dedicated IP address, behind our firewall, etc. Everyone's...
3
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with "SQL0964C The transaction log for the database...
7
by: P. Adhia | last post by:
Sorry for quoting an old post and probably I am reading out of context so my concern is unfounded. But I would appreciate if I can get someone or Serge to confirm. Also unlike the question asked in...
4
by: andrewcw | last post by:
I am moving some code forward from .NET 1.1. I was able to load the XSL file and perform the transform. The MSDN documentation looks like it should be easy. But I get a compile error. Ideas ?...
8
by: Joe Withawk | last post by:
I have a solution consisting of a c# project as win application and a c++ project as classlibrary. Both are .net 2.0 The classlibrary handles some loading of quicktime movies, but that should not...
2
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.