Finding screen size inside of PHP
Jun 12, 2008 in Uncategorized, geektalk
So I'm working on a side project that's mainly just for me, but it's so damn handy I might just make it publicly available when it's done (probably for a small monthly fee). It's basically a super quick way to run certain types of scan for stocks during the day, picking out data that's usually hard to get until the end of the day. I'm tying it into the OptionsXpress API so that when I identify a good entry or exit point on a stock, I can change my position with the click of a button.
I've been designing the site to automatically rescale for my mobile phone, but I need a way to determine if I'm looking at it on the phone or on a desktop - and since my mobile browser is generally configured to identify as a desktop browser (so that I don't get sent to the "mobile version" of the sites I visit) it's harder to do. My browser does a great job of rendering full-screen pages and scaling them - if you've seen the iPhone browser, both Opera Mini and Pixsel do something similar though without 'multi-touch'.
That said, there's something to be said for designing a website that will gracefully scale when it's on a phone.
But when the browser identifies itself as a desktop browser, what's left? Javascript can pick up the screen size, but what about PHP? All my pages are created in PHP...
