djultra89 Posted November 3, 2013 Share Posted November 3, 2013 hi there could someone help me sort the top bits out of the coding please as it's not in GMT time or day = '2000' && $time "; break; case ($time >= '1000' && $time "; break; default: echo"images/onair/kix103.png"; break; } } elseif($day == 6) { echo"images/onair/kix103.png"; } else { switch($time) { case ($time >= '0600' && $time "; break; case ($time >= '1000' && $time "; break; case ($time >= '1500' && $time "; break; case ($time >= '1900' && $time "; break; case ($time >= '2400' && $time "; default: echo"images/onair/kix103.png"; break; } } ?> Link to comment Share on other sites More sharing options...
PapaBearPW Posted November 4, 2013 Share Posted November 4, 2013 Instead of using putenv(), try using: date_default_timezone_set("GMT"); That is the proper way to set the default timezone in your script as of php 5.x AFAIK. Also, I would remove the mktime() function as it is not doing anything...since you don't seem to be setting it to a variable. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
djultra89 Posted November 6, 2013 Author Share Posted November 6, 2013 ok so is this how it goes please correct me if im wrong = '2000' && $time "; break; case ($time >= '1000' && $time "; break; default: echo"images/onair/kix103.png"; break; } } elseif($day == 6) { echo"images/onair/kix103.png"; } else { switch($time) { case ($time >= '0600' && $time "; break; case ($time >= '1000' && $time "; break; case ($time >= '1500' && $time "; break; case ($time >= '1900' && $time "; break; case ($time >= '2400' && $time "; default: echo"images/onair/kix103.png"; break; } } ?> Link to comment Share on other sites More sharing options...
PapaBearPW Posted November 6, 2013 Share Posted November 6, 2013 //set timezone using date_default_timezone_set() date_default_timezone_set("GMT"); //mktime(0,0,0,1,1,1970); $day = date("N"); $time = date("Hi"); if ($day == 7) { switch($time) { case ($time >= '2000' && $time echo"http://hyper-radio.co.uk/djimages/djultra.jpg"; break; case ($time >= '1000' && $time echo"images/onair/kix103.png"; break; default: echo"images/onair/kix103.png"; break; } } elseif($day == 6) { echo"images/onair/kix103.png"; } else { switch($time) { case ($time >= '0600' && $time echo"images/onair/steveandboomer.png"; break; case ($time >= '1000' && $time echo"images/onair/kc.png"; break; case ($time >= '1500' && $time echo"images/onair/jr.png"; break; case ($time >= '1900' && $time echo"images/onair/jrandalharvey.png"; break; case ($time >= '2400' && $time echo"images/onair/blairgarner.png"; break; default: echo"images/onair/kix103.png"; break; } } ?> http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
djultra89 Posted November 6, 2013 Author Share Posted November 6, 2013 many thanks great help Link to comment Share on other sites More sharing options...
PapaBearPW Posted November 6, 2013 Share Posted November 6, 2013 No problem. Glad to help. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
xhilaration Posted May 26, 2017 Share Posted May 26, 2017 So would this be this est, nowonair.php? Can I have a stand alone folder - for example: instead of this: images/djsimg/djpic.jpg to this: The folder would be 'djsimg' djsimg/djpic.jpg Thank you 🌺 Xhilaration 🌺 Link to comment Share on other sites More sharing options...
PapaBearPW Posted June 2, 2017 Share Posted June 2, 2017 If by "est" you mean Eastern Standard Time in the USA for the timezone, then you would need to use: date_default_timezone_set("US/Eastern"); As to where you put your images, that should work too as long as you address it correctly in the script (see below) and the djsimg folder is located in the same location as the php file. echo"djsimg/djpic.jpg"; Hope that helps. 1 http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
xhilaration Posted June 3, 2017 Share Posted June 3, 2017 If by "est" you mean Eastern Standard Time in the USA for the timezone, then you would need to use: date_default_timezone_set("US/Eastern"); As to where you put your images, that should work too as long as you address it correctly in the script (see below) and the djsimg folder is located in the same location as the php file. echo"djsimg/djpic.jpg"; Hope that helps. Most definitly, thank you so much!!! got another ? can we make this into a file & use a code like this Yes, I don't have the codeing right but this is example. I want to put a simple php code in the body where I want it to appear vs having to put entire code in body 🌺 Xhilaration 🌺 Link to comment Share on other sites More sharing options...
PapaBearPW Posted June 3, 2017 Share Posted June 3, 2017 (edited) No problem. Yes. Assuming you name the file "djimg.php", for example, the code to include it in another php script should be: include "djimg.php"; Edited June 3, 2017 by PapaBearPW 2 http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
xhilaration Posted June 4, 2017 Share Posted June 4, 2017 No problem. Yes. Assuming you name the file "djimg.php", for example, the code to include it in another php script should be: include "djimg.php"; ty PapaBear, most apprciative with your help again 🌺 Xhilaration 🌺 Link to comment Share on other sites More sharing options...
PapaBearPW Posted June 4, 2017 Share Posted June 4, 2017 Happy to help when I can. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now