
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: #!/bin/sh 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) So that's your answer. You need to check the value of HTTP_USER_AGENT to see if it contains the sequence "PSP". You can do that within a CGI script or with a scripting language like JavaScript, depending on your preferences. There's also a second variable you could check for that I've only ever seen with the PSP browser: HTTP_X_PSP_BROWSER=2.60 (LX) 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!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.
Categorized:
CGI Scripts and Web Site Programming
, Sony PSP, MP3 Players, Etc.
(Article 5246)
Tagged: Previous: Check free space on Windows XP? Next: How do I get started with affiliate marketing? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. I have an article about how to do this in ASP.NET 2.0 so it automatically detects and reformats the page for the PSP browser... Here ya go: http://community.hackingpsp.com/forums/283/ShowPost.aspx Best, -Auri DAVE THESE ARENT HELPING ME I JUST WANT TO GET INTERNET ON MY PSP I TRIED MAND SITES I HAVE A USB CABLE TO AND A DNS CABLE IT DOESENT DO ANY THING AND WHEN I CONNECT MY USB CABLE TO THEY COMPUTER THEN IT SAYS CONNECT A USB CABLE WHEN I GO TO SETTING AND CLICK TEST USB CONNATION OK I JUST WANT TO KNOW HOW TO GET INTERNET AND PLAY ONLINE GAMES THATS ALL I ASK For the guy above, the PSP connects to the internet through a wireless connection, not through any cables. Even if you lack any common sense, at least read the damn manual, or even the box it came in. I'm surprised you actually used a computer to type that. Posted by: Tim at July 30, 2006 4:17 PMTim, i couldnt agree more....people who dont read their hand books/ manuals have no grounds to ask questions to answers they could solve themselves....COME ON PEOPLE! if you arent going to read the manual than AT LEAST google "How to connect my psp to the internet" DUH......people aggravate me soo....much Posted by: Danny at April 13, 2007 6:10 PMYeah..I guess Sony didn't figure you'd need to connect to the internet with USB. Since that would imply that you are sitting in front of a perfectly capable, internet ready PC in the first place ;P Posted by: Brandon at May 8, 2007 4:18 PMwhen does psp version 4.00 come out for psp? and what will it include Posted by: james at March 1, 2008 8:12 PMIs it possible to read CGI scripting from the PSP. I would like to read the cgi from my satellite internet terminal in order to see connection status and so on. Posted by: Malcolm Bevege at April 5, 2008 1:33 AMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|
Looking for all your Sony PSP answers in one place, organized as a convenient quick reference work? Then you need Dave's Everything Guide to the Sony PSP, a 150-page ebook ready for you to download right now!