I struggle because I'm not good with the date data type. My first failure was to count the weeks between the start date and the current date and I failed. Then I built a PHP switch trap with current date falling between two dates or after being post season, would be perfect. When I hover on the ESPN week selector, it reveals the two dates. How do I code an IF current date between date1 and date2?
The difference between college and pro is a separate problem that I think I can handle. ... I like your solution and am googling for a between dates php solution. Gary -----Original Message----- From: Virgil Bierschwale [mailto:vbier...@gmail.com] Sent: Tuesday, September 24, 2013 1:18 PM To: 'ProFox Email List' Subject: RE: php date function Here is some code I use for changing video's each day Should be self explanatory, but if not, give me a shout <?php //Give what day of the week it is. Returns Sunday through Saturday. $day = date("l"); if ($day == "Monday") { // Clint Eastwood echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0" allowfullscreen></iframe>'; // Gomer Pyle echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; } elseif ($day == "Tuesday") { // College Girl echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/j6iqTHJHW5o?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; // Clint Eastwood echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0" allowfullscreen></iframe>'; } elseif ($day == "Wednesday") { echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0" allowfullscreen></iframe>'; } elseif ($day == "Thursday") { echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0" allowfullscreen></iframe>'; } elseif ($day == "Friday") { echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0" allowfullscreen></iframe>'; } elseif ($day == "Saturday") { echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0" allowfullscreen></iframe>'; } elseif ($day == "Sunday") { echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; echo '<iframe width="510" height="315" src="http://www.youtube.com/embed/1sJl5OC7LCU?feature=player_embedded" frameborder="0" allowfullscreen></iframe>'; } ?> -----Original Message----- From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Gary Jeurink Sent: Tuesday, September 24, 2013 1:09 PM To: 'ProFox Email List' Subject: php date function Could somebody get me started on a PHP switch or IF ELSE function to set the current week of a football season. Right now I am setting the date manually each week with the following: <?php // function TO GET curweek of football season function getCurWeek() { $curWeek = '05'; return $curWeek; } // end of getCurWeek ?> Ideally I want to test the current date if it's between the start and end date of each week. The wrinkle is and I need to adjust somehow, the pro season is 1-week behind the college season and anything past curweek['15'] will be 'PS' post season for college and past curweek['17'] for pro's will be 'PS' if you follow. I'll probably have to return two values instead of the 1 that I'm doing now. I tried several and my php date syntax doesn't work. Gary Jeurink --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/475E2F0C9BC5498D8B216F5236E62B27@OwnerPC ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.