First of all... Merry Christmas
Second... It probably isn't, but still I'll ask... Is it possible to detect the following in Perl?
1) JavaScript-enabled browser
2) 1024x768 or higher resolution
3) At least 256 colours enabled
I'm guessing 1 is possible. 2 and 3 aren't. Am I right and how would I go about doing any of them?
Thanks in advance
These things aren't possible as perl is executed on server side, what you need is client side script, such as javascript.
You can however in perl print out javascript to do as you require, which will be processed on the cliemt side. But Im guessing you want perl to act differently depending on the results of your javascript tests which wont be possible.
Well, I think the most you could do is do detection in JS and then make it refresh to the page again, but with variables appended...
/me bets that makes no sense whatsoever...
It's possible, Dave... Or I could just use document.writeln... Okay, I'll think about it. Thanks everyone.
If the browser does not send these info to the server, you cant get the values... And afaik, none of the browsers send this kind of info...
Anyway, I'll try to see the headers they send to server
Headers coming from various browsers:
[Microsoft IE 5.0]
GET / HTTP/1.1
Accept: application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: tr
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: localhost
Connection: Keep-Alive
[Opera 6.04]
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 6.04 [en]
Host: localhost
Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap, */*
Accept-Language: en
Accept-Charset: windows-1252;q=1.0, utf-8;q=1.0, utf-16;q=1.0, iso-8859-1;q=0.6, *;q=0.1
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Connection: Keep-Alive
[Netscape 6.2]
GET / HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-GB; rv:0.9.4) Gecko/20011019 Netscape6/6.2
Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, image/png, image/jpeg, image/gif;q=0.2, text/plain;q=0.8, text/css, */*;q=0.1
Accept-Language: en-gb
Accept-Encoding: gzip, deflate, compress;q=0.9
Keep-Alive: 300
Connection: keep-alive
[Netscape 4.77]
GET / HTTP/1.0
Connection: Keep-Alive
User-Agent: Mozilla/4.77 [en] (Win98; U)
Host: localhost
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
What he needs it client side script, which perl is not, so it can't be achieved in perl, only java, vb script etc...
But daves Idea will work, when you detect something on the client side you redirect them back to your script with variables appended in the URL string, which you can read in in perl and run the appropriate code.
Good luck!
Okay, solved using JavaScript... Thanks everyone
Results:
http://chris.iphq.co.uk
Your site is too slow for now...
Mmm... A few people have told me it's a bit slow loading. I'm getting a new CPU for Christmas, so the speed should improve within the next week.