Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5

Thread: [PHP] Help

  1. #1
    Join Date
    Apr 2005
    Location
    Milton Keynes
    Posts
    725
    Tokens
    2,589
    Habbo
    -Paul.

    Latest Awards:

    Default [PHP] Help

    Hey Im working on a website and im trying to make the banner change at a time of the day

    Code:
    <? if(date(H) < 18 && date(H) > 6){
    echo "<img src="image link">";
    }else{
    echo "<"img src="image link">";
    }
    ?>
    Thats my code but it doesnt seam to like it

    anyone see anything?
    DJ Porky

    2006-2015
    Habtips - Habbolot - Habbox - Habbed - HHGS

  2. #2
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <? if(date("H") < 18 && date("H") > 6){
    echo 
    "<img src=\"image link\">";
    }else{
    echo 
    "<img src=\"image link\">";
    }
    ?>
    Need the quote marks

    Lew.
    Im not here to be loved, I love to be hated :-}


  3. #3
    Join Date
    Apr 2005
    Location
    Milton Keynes
    Posts
    725
    Tokens
    2,589
    Habbo
    -Paul.

    Latest Awards:

    Default

    Thanks alot (+ rep) One more question - Thats saying if its before 6:00PM and after 6:00AM then show a certain image then if its after 6PM show another - its now 7:01PM and its showing the wrong picture?
    Last edited by -paul.; 21-12-2010 at 07:03 PM.
    DJ Porky

    2006-2015
    Habtips - Habbolot - Habbox - Habbed - HHGS

  4. #4
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    You might want to check that your server is set to the correct time then.
    You could check the hour by simply echoing your date("H").
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  5. #5
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    Add
    PHP Code:
    <php date_default_timezone_set("Europe/London"); ?> 
    This will set the time of the script to GMT (UK Time)

    Lew.
    Im not here to be loved, I love to be hated :-}


Posting Permissions

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