Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 30th, 2006, 2:59 AM   #21
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 3 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
Just wondering, why is using a server side script to display different layouts for different browsers a bad thing? When I heard him say it, I though "wow why hadn't I thought of that before". I know what you mean about writing code for standards compliant browsers and hacking for others, because thats how I've always done it.

The only downside to the server side script thing IMO, is that you'd have to maintain more than one script.
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Old Sep 30th, 2006, 3:33 AM   #22
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Exactly.
Quote:
Originally Posted by PHP Manual
'HTTP_USER_AGENT'

Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's output to the capabilities of the user agent.
I use it, myself, for the hacks on the page, but it isn't a done deal. One can also use browser-sniffing or capabilities on the client side, if using client side script.

Example:
	if ($firstSub)		
        {
		$outfile [] = '<ul class="';
		if ($thisUn  || ($browser == "IE")) $outfile [] = 'open';
		$outfile [] = 'sub" id="sub">'."\n";
	}
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers

Last edited by DaWei; Sep 30th, 2006 at 3:46 AM.
DaWei is offline   Reply With Quote
Old Sep 30th, 2006, 4:29 AM   #23
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 3 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
Ok I see, so the browser can request a page without supplying the user-agent part of the header.
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Old Sep 30th, 2006, 8:46 AM   #24
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Yeah. It's why people use client-side sniffing if they have client-side script to use. You could send things to the server with your own standalone program (see some recent questions on the forum) and tell it about anything you wanted to, so long as the request conformed to the RFC.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does someone have a site for me? nnxion PHP 18 Jan 4th, 2006 5:17 PM
Site works in Firefox but not IE smoked_out_haze HTML / XHTML / CSS 8 Oct 27th, 2005 3:51 AM
Rereouting site through php. ghost_stalker PHP 28 Sep 20th, 2005 2:20 PM
extracting info from a remote site. scorpiosage PHP 1 Jul 8th, 2005 4:41 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:34 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC