Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By arnage

Thread: Dinamic css design

  1. #1
    Moderator arnage's Avatar
    Join Date
    May 2009
    Location
    Serbia
    Posts
    713
    Thanks
    165
    Thanked 183 Times in 80 Posts
    Rep Power
    5

    Default Dinamic css design

    algorithm:

    PHP Code:
    $css = isset($_GET['css']) ? trim($_GET['css']) : '';

    $thecss = array('one''two''tree''four'); // Just letter names

    if (!isset($css) || empty($css)) {
    $css 'one';
    }
    elseif (isset(
    $css) && array_key_exists($css$thecss)) {
    $css $thecss[$css];
    } else {
    if (!empty(
    $css) && !in_array($css$csses)) { exit; }

    interface:

    Code:
    <form method="get" action="./index.php">
    <p>
    <select name="css">
    <option value="one">one</option>
    <option value="two">two</option>
    <option value="tree">tree</option>
    <option value="four">four</option>
    </select>
    <input type="submit" value="Ok"/>
    </p>
    </form>
    usage:

    Code:
    <link rel="stylesheet" type="text/css" href="./folder/'.$css.'.css"/>
    Last edited by arnage; 20-04-11 at 20:38.
    metulj likes this.
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

  2. #2
    Administrator GumSlone's Avatar
    Join Date
    Mar 2005
    Location
    Mars, GumCity
    Posts
    1,495
    Thanks
    125
    Thanked 573 Times in 201 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    you could do the php part like this,
    PHP Code:
    $css = isset($_GET['css']) ? trim($_GET['css']) : ''
    $thecss = array('one''two''tree''four'); // Just letter names
    if (in_array($css$thecss)==false) {
        
    $css 'one';

    Advertise your mobile site for FREE with [Only registered and activated users can see links. Click Here To Register...]

    [Only registered and activated users can see links. Click Here To Register...]


  3. The Following User Says Thank You to GumSlone For This Useful Post:

    arnage (18-04-11)

  4. #3
    Moderator arnage's Avatar
    Join Date
    May 2009
    Location
    Serbia
    Posts
    713
    Thanks
    165
    Thanked 183 Times in 80 Posts
    Rep Power
    5

    Default

    Well i guess that elegant code comes with the experience. Maybe im too obsessed with checking...
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Flash Design
    By ewanz in forum Design - Templates - Graphics
    Replies: 0
    Last Post: 08-03-11, 04:44
  2. Logo Design
    By subzero in forum Design - Templates - Graphics
    Replies: 5
    Last Post: 05-03-11, 08:32
  3. t-shirt design help
    By subzero in forum Design - Templates - Graphics
    Replies: 10
    Last Post: 24-01-11, 01:45
  4. web-design help
    By ripkk2tfk in forum Design - Templates - Graphics
    Replies: 13
    Last Post: 30-04-09, 15:06
  5. Php To Php And Wml Dinamic Page
    By sweetangel in forum Coding Forum
    Replies: 1
    Last Post: 18-04-07, 12:45

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
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19