Jump to content

date msg


the-botman

Recommended Posts

Hi i need to know if my code is rite

<?php
$year = $date('Y');
$xmas = mktime(0, 0, 0, 12, 25, $year);
$newyear = mktime(0, 0, 0, 01, 01, $year);
$today = time();
if($xmas == $today) {
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">Bha Would Like To Wish all his supporters a Merry Christmas </div></div>';
}
else if($newyear == $today) {
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">Bha Would Like To Wish all his supporters a Happy New Year</div></div>';
}else {
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">TV guide Now Added and is updated every 2 min  also BhasIRC chat apps are now all updated hope you guys like it</div></div>';
}
?>

Link to comment
Share on other sites

No ... it just gives me a blank screen were the msg should be and there is notting wrong with this part of the code becuase i have it working rite now

echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">TV guide Now Added and is updated every 2 min  also BhasIRC chat apps are now all updated hope you guys like it</div></div>';

so i tought i some how got my code wrong thats why its not working the way it should and came here to ASK FOR HELP

Thanks in advance

Botman

Link to comment
Share on other sites

Because these conditions:

 

if($xmas == $today)
if($newyear == $today)

 

Evaluate to true on one second only (at midinight of Dec 25th and Jan 1st respectively). If you want them to be true for the whole day, you have to compare month and day of month. Actually in case of New Year, just check if day of year == 1

Link to comment
Share on other sites

ok so this is rite i am guessing

<?php
if(date('z') == '0') {
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">New Year is meant for celebrations and spending joyous time with loved ones.May the beauty of New Year be with you forever and your wishes of peace,health and happiness ring true.</div></div>';
} elseif (date('md') == '1225') {
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">May the spirit of Christmas bring u peace, The gladness of Christmas give u hope, AND The warmth of Christmas grant u love  Merry Christmas</div></div>';
}else {
echo '<div class="hd5a">';
echo '<div style="display: -wap-marquee; -wap-marquee-loop: 100; font-size: 8pt; color:#666;">TV guide Now updated, BhasIRC chat apps are now all updated hope you guys like it</div></div>';
}


?>

thanks for all your help

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.