SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member seattlecane's Avatar
    Join Date
    Mar 2003
    Location
    seattle
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A little help please

    I hope this is the right forum...

    I am using a countdown script in a page I am designing

    Code:
    <? 
    
    $day = 30; // Day of the countdown 
    $month = 8; // Month of the countdown 
    $year = 2003; // Year of the countdown 
    
    // mktime is the marked time, and time() is the current time. 
    $target = mktime(0,0,0,$month,$day,$year); 
    $diff = $target - time(); 
    
    $days = ($diff - ($diff % 86400)) / 86400; 
    $diff = $diff - ($days * 86400); 
    $hours = ($diff - ($diff % 3600)) / 3600; 
    $diff = $diff - ($hours * 3600); 
    $minutes = ($diff - ($diff % 60)) / 60; 
    $diff = $diff - ($minutes * 60); 
    $seconds = ($diff - ($diff % 1)) / 1; 
    
    printf("There are $days days, $hours hours, $minutes minutes, Until Kickoff"); 
    ?>
    Is there a simple way to set the font, color, size of the output without affecting the rest of the page?

    Thanks

  2. #2
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, look into Cascading Style Sheets (CSS) and HTML.

    Your code would look something like this:

    echo "<span class='[class name]'>There are $days days, $hours hours, $minutes minutes, until kickoff!</span>";

    Or you could use the deprecated <font> tags:

    echo "<font color='color'>There are $days days, $hours hours, $minutes minutes, until kickoff!</font>";

    However, I would HIGHLY recommend using CSS.
    John


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •