How do I detect the Sony PSP Web browser on my site?
I'm looking to make a Sony PSP optimized website, but I want it so that it can only be viewed by the PSP and if viewed in a normal pc internet browser, you have a message saying "please visit us using your psp" or something along those lines. How do I do that?
This is a very cool question and one that turns out to be pretty easy to solve once you realize that all Web browsers return information about themselves using a CGI environment variable called HTTP_USER_AGENT.
I wrote a quick little shell script that displays the calling environment when accessed via a browser and used that for testing:
When this script is invoked from Apple's Safari browser, for example, I see:
HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
but when I go to my Sony Playstation Portable (PSP) and use its built-in Web browser to access the very same script, I see:
HTTP_USER_AGENT=Mozilla/4.0 (PSP (PlayStation Portable); 2.00)
There's also a second variable you could check for that I've only ever seen with the PSP browser:
I talk about how to accomplish this sort of conditional page delivery in my book Creating Cool Web Sites with HTML,XHTML and CSS too, as it happens!
Hope that gets you moving in the right direction!
More Useful iPod, Sony PSP and MP3 Player Help Articles:
✔ Deleted iTunes library but still have tracks on iPod...
Hi Dave, I have been following your newsletter for awhile now. Most of your topics are way over my head but very interesting....✔ How do I fix the time / date on my Apple iPod Touch?
I pulled my iTouch [ed note: "iPod Touch", actually] out of the drawer and when it was fully charged I realized that the...✔ Can I remove songs from an unsync'd iPod Touch?
My son has just come home from his uncle's house with a new iPod. Very nice. Full of a wide variety of music,...✔ Get started with iTunes Match!
I have a huge library of music, Dave, and want to be able to enjoy it on all my Apple devices, but am...✔ Can I pre-order a music CD from the Apple iTunes Store?
I have a bunch of bands and musicians I follow faithfully and when I see that there's a new CD coming out from...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
I do have a comment, now that you mention it!
Check This Out Too...
Look for Answers
All Our Categories
Apple iPad Help
Articles and Reviews
Auctions and Online Shopping
Blogs and Blogging
Building Web Site Traffic
Business and Management
Computer and Internet Basics
d) None of the Above
Google Gmail Help
Google Plus Help
Industry News and Trade Shows
iPhone and Cell Phone Help
iPod, Sony PSP and MP3 Player Help
Kindle Fire Help
Mac OS X Help
Pay Per Click (PPC) Advertising
Search Engine Optimization (SEO)
Shell Script Programming
Tech Support Video Help
The Writing Business
Twitter, LinkedIn and Social Network Help
Unix and Linux Help
Video Game Tips and Help
Windows PC Help
Find Me on Google+
ADT on G+