Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Peter H. Coffin" Newsgroups: comp.lang.php Subject: Re: The prefered way to handle mobile apps? Date: Fri, 29 Jul 2011 08:46:20 -0500 Organization: A noiseless patient Spider Lines: 21 Message-ID: References: <99cin5FioiU1@mid.individual.net> <99f2ipFgb9U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="le/2G4+BNpieVhQI6uJ2Lw"; logging-data="676"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BZRMWgAuWGkB0CQrhrw2D" User-Agent: slrn/0.9.9p1 (OpenBSD) Cancel-Lock: sha1:g8kWIkTsHOhqjiD7zjDiQkekees= Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:2680 On Fri, 29 Jul 2011 08:33:59 +0200, Simon wrote: > 2) The time spent at every page load to look if this is a mobile or not. > > In the end, I might settle for $_SERVER['HTTP_X_WAP_PROFILE'] and/or > $_SERVER['HTTP_ACCEPT'] (wap) Well, you could set a cookie or a session var for what brower type to expect, but that'd probably take LONGER than just handling the user agent parsing. After a few page loads, all the data necessary to handle the agent examination is probably cached (or could be cached at least), and not really going to be looking a a whole lot of time to make the determination anymore. Lots of work has already been done to make sure that repeated operations take as little effort as possible, so you might as well take advantage of that over writing more code to save very little time. -- 32. I will not fly into a rage and kill a messenger who brings me bad news just to illustrate how evil I really am. Good messengers are hard to come by. --Peter Anspach's list of things to do as an Evil Overlord