|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
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
|
|
|
|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
Joined: Oct 2000
Posts: 743 |
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.
I can't afford a good signature editor
|
|
|
|
Joined: Dec 2001
Posts: 699
Member
|
Member
Joined: Dec 2001
Posts: 699 |
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...
|
|
|
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
It's possible, Dave... Or I could just use document.writeln... Okay, I'll think about it. Thanks everyone.
|
|
|
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
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
|
|
|
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
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
|
|
|
|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
Joined: Oct 2000
Posts: 743 |
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!
I can't afford a good signature editor
|
|
|
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
Okay, solved using JavaScript... Thanks everyone Results: http://chris.iphq.co.uk
|
|
|
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
Your site is too slow for now...
|
|
|
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
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.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|