TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01-02-2009, 10:08 AM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default what method do you use with php when displaying a stylesheet?

this is how i display a style sheet for whatever browser that opens the page.

Code:
function style() {
$browser = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/MSIE6.0/',$browser)) {
echo "ie6.css";
}

if(preg_match('/Firefox/',$browser)) {
echo "firefox.css";
}
}

//then in the html i put something like this

<head>
<link href="css/<?php style(); ?>" type="text/css" rel="stylesheet">
</head>
is there a better method to do than doing it this way? since this is the only way that i know i'm wasting more time by creating a stylesheet for every browser that exists than finding another way.

whats another way of doing this??


thanks
__________________
no signature set
sarmenhb is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tips: Fastest PHP Code jordie Tips & Tricks 8 05-14-2013 12:47 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
Tips: PHP security Village Idiot Tips & Tricks 22 11-23-2007 11:17 PM
My Favourite PHP Magic Method: __call Wildhoney Advanced PHP Programming 10 11-16-2007 03:32 AM


All times are GMT. The time now is 03:20 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design