Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 1,704
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
First of all... Merry Christmas smile

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 smile

Sponsored Links
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
Moderator / Code Fixer
Offline
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 frown
Joined: Dec 2001
Posts: 699
Member
Member
Offline
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
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
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. smile

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 smile

Sponsored Links
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
Offline
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 frown
Joined: Nov 2001
Posts: 1,704
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Okay, solved using JavaScript... Thanks everyone laugh

Results: http://chris.iphq.co.uk smile

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
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
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. wink

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)