SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Enthusiast mahmoud's Avatar
    Join Date
    May 2001
    Location
    Egypt
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php to control the view of css

    Hello,
    I want to create a php file to check the visitor browser and version and upon it view a certain css

    In my pages I have :
    Code:
    <style type="text/css" media="all">@import "/css/css.php?1";</style>
    in the css.php I have :
    Code:
    <?php if(ereg("\?1$", $REQUEST_URI)) {
    if (strstr (getenv('HTTP_USER_AGENT'), 'MSIE')) { 
    include "/css/ie.css";
    }
    elseif (strstr (getenv('HTTP_USER_AGENT'), 'Netscape')) { 
    include "/css/ns.css";
    }
    elseif (strstr (getenv('HTTP_USER_AGENT'), 'opera')) { 
    include "/css/opera.css";
    }
    else {
    include "/css/others.css";
    }}
    ?>
    I would like it to check the version also can anyone help?
    Also is it possible to prevent users from downloading the css if accessed css.php?1 ?
    Last edited by mahmoud; May 31, 2001 at 07:03.
    Mahmoud


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
  •