Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30
  1. #11
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Quote Originally Posted by gtavc1210 View Post
    <?
    $timer_date = date("d,M,Y");
    if($timer_date == "16,Dec,2007")
    {

    echo '';

    }
    else
    {

    echo '';

    }
    ?>

    this works fine for me

    http://www.parkerweblogic.co.uk/testdate.php = Dec 07
    http://www.parkerweblogic.co.uk/testdate1.php = Nov 07


    Putting <?PHP is pointless! just put <?
    <? is not preferred syntax, and is being considered by the PHP group to be removed from the software, along with other variants (<script type="php">, <% etc). Use <?PHP, it's frowned on otherwise.

    If forcing GMT doesn't work, check what your server is outputting for date().

    PHP Code:
    <?PHP

    echo date('d M Y');

    ?>
    Upload that, and see what it outputs.

  2. #12
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default

    16 Nov 2007

    Dammit.
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

  3. #13
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    That's good, at least your PHP config is set up correctly.

    Don't include this into the file, upload it to your server seperately.

    PHP Code:
    <?PHP

    if(date('d M Y') == '16 Nov 2007') {

        echo 
    '<div class="header2008"></div>';
        
    }

    else {

        echo 
    '<div class="header"></div>';
        
    }
    ?>
    If that works, then it's probably just a caching issue. Clear your cache, restart browser, try again.

  4. #14
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default

    Nothing appears when I do that. Only the background. Don't worry about it, I'll just do it manually before I have to go
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

  5. #15
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Did you try uploading the code above to a seperate file? I'm sure it's just a caching issue, everything else seems to be working correctly

  6. #16
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default

    I did,

    http://jamesy155.8888mb.com/test.php

    You can check the source if I'm doing it wrong.
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

  7. #17
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Rofl...

    PHP Code:
    <div id="header">
      <h1>i<span>Rant</span></h1>    
        <?PHP if(date('d M Y') == '16 Nov 2007') {

        echo 
    '<div id="header2008"></div>';
        
    }

    else {

        echo 
    '<div id="header"></div>';
        
    }
    ?>
       
    </div>
    Changed the <div class to <div id in both circumstances. Try that

    EDIT: Also, you're declaring your normal header at the top, before the iRant text. Might wanna fix that

    EDIT2: ALSO, you've put the PHP in the <head> of the document.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    
    <title>Untitled Document</title>
    
    </head>
    <div class="header2008"></div> 
    
    <body>
    </body>
    </html>
    Move it to body
    Last edited by Beau; 16-11-2007 at 09:08 PM.

  8. #18
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default

    div id= works, But the headers are now stacked on top of each other =/

    At least we are getting somewhere
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

  9. #19
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Read my first edit ^

  10. #20
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default

    Ok, fixed that But now the
    <h1>i<span>Rant</span></h1>
    Won't appear right without the first <div id="header">

    Any way I can put this into the php?
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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