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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: PHP in CSS?

  1. #1
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default PHP in CSS?

    Is it possible for me to put php in a css file eg to randomize a color.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #2
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    I'm not sure but there's one way of finding out , test it by trying it out .
    If it doesn't work by doing it in the stylesheet then if it's something like the colour for one certain thing, have the css within the HTML tags with the php controlling it .

  3. #3
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    If I direct css via <link> in a .css will that still allow php?
    How could this hapen to meeeeeeeeeeeeeee?lol.

  4. #4
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    90

    Latest Awards:

    Default

    Why not make CSS files for the colours you want then randomize the css file that is included.

  5. #5
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    no make a file i.e css.php

    and have
    Code:
    <style type="text/css">
    css goes here and you can use php if u use <?PHP around the bit you want phped dont forget ?> to close :)
    </style>


  6. #6
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    Quote Originally Posted by Robbie! View Post
    Why not make CSS files for the colours you want then randomize the css file that is included.
    Or just make different (css) classes and make the php script randomize which class to be used.
    Easyest in my opinion.




    Regards,
    Olivier Pauwels

  7. #7
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Quote Originally Posted by [oli] View Post
    Or just make different (css) classes and make the php script randomize which class to be used.
    Easyest in my opinion.




    Regards,
    Olivier Pauwels
    thats a good idea imo i think i will use that in the future


  8. #8
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    imo?

    and I already have a style.css is there any bypass, eg redirect from .css to .php or could I use mod rewrite :S
    How could this hapen to meeeeeeeeeeeeeee?lol.

  9. #9
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    Quote Originally Posted by Reconix View Post
    imo?

    and I already have a style.css is there any bypass, eg redirect from .css to .php or could I use mod rewrite :S
    huh what ?

    inside your style.css put this:

    .style1{
    //styles here
    }

    .style2{
    //styles here
    }

    .style3{
    //styles here
    }

    .style4{
    //styles here
    }

    Then in your main file place a php script that randomizes to use

    <div class="style1"></div>
    or
    <div class="style2"></div>
    or
    <div class="style3"></div>
    or
    <div class="style4"></div>

    or use <span>'s, whatever you need :p


    Easyest way no ?


    (PS: imo = in my opinion)

  10. #10
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    The thing is I already have like 60 pages, so i was jw if it was possible to change the .css or .htaccess
    How could this hapen to meeeeeeeeeeeeeee?lol.

Page 1 of 2 12 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
  •