Odgovori: Re: screen size...

2004-11-05 Thread lfurlan
Easier and shorter way:



document.write("Screen resolution: " + screen.width + " X " + screen.height)



enjoy, Luka

Od: Chasecreek Systemhouse <[EMAIL PROTECTED]>
Datum: 2004/11/05 Pet AM 02:27:46 CET
Za: Luinrandir Hernsen <[EMAIL PROTECTED]>,  [EMAIL PROTECTED]
Kp: [EMAIL PROTECTED]
Zadeva: Re: screen size...

On Thu, 4 Nov 2004 10:48:12 -0500, Luinrandir Hernsen
<[EMAIL PROTECTED]> wrote:
> It there a way to get the screen size info using perl?

As a CGI, not really.  Try:



toolkit = java . awt . Toolkit . getDefaultToolkit ();
screensize = toolkit . getScreenSize ();
document . writeln
(
"<p>" +
"You screen is " + screensize . width + " pixels wide." +
"</p>"
);
document . writeln
(
"<p>" +
"You screen is " + screensize . height + " pixels tall." +
"</p>"
);





HOWEVER, The remote client must have JS enabled and have Java installed  =/

-- 
WC -Sx- Jones
http://youve-reached-the.endoftheinternet.org/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





=
Mirko tipka na radirko.
http://www.worldofspectrum.org/
=


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: screen size...

2004-11-05 Thread Sean Davis
On Nov 4, 2004, at 10:03 PM, Luinrandir Hernsen wrote:
Ok.. now how do I get the screen size info to a hidden input (in a 
form) or
send back to a cgi ?

I'm guessing as a hiiden input with in a form or as part of the link
command, which calls the game.cgi?W=Wvar&H=Hvar
"" +
"click here"+
""

yes ?yes? did I do it.. I really don't know JS : (
just guessing...
BTW .. thanks for your help!
Lou.

- Original Message -
From: "Chasecreek Systemhouse" <[EMAIL PROTECTED]>
To: "Luinrandir Hernsen" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, November 04, 2004 8:27 PM
Subject: Re: screen size...

On Thu, 4 Nov 2004 10:48:12 -0500, Luinrandir Hernsen
<[EMAIL PROTECTED]> wrote:
It there a way to get the screen size info using perl?
As a CGI, not really.  Try:


toolkit = java . awt . Toolkit . getDefaultToolkit ();
screensize = toolkit . getScreenSize ();
document . writeln
(
"<p>" +
"You screen is " + screensize . width + " pixels wide." +
"</p>"
);
document . writeln
(
"<p>" +
"You screen is " + screensize . height + " pixels tall." +
"</p>"
);



If you have a form that has a hidden field and you can rely on 
javascript, you can set the values of hidden fields in the form by 
something like:




<!--
document.write(document.anotherName.hiddenName.value+'<br>');
document.anotherName.hiddenName.value = 'hello world';
document.write(document.anotherName.hiddenName.value+'<br>');
//-->
I found this on:
http://developer.irt.org/script/form.htm
Hope this does what you want.
Sean
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: screen size...

2004-11-05 Thread Luinrandir Hernsen
Ok.. now how do I get the screen size info to a hidden input (in a form) or
send back to a cgi ?

I'm guessing as a hiiden input with in a form or as part of the link
command, which calls the game.cgi?W=Wvar&H=Hvar

"" +
"click here"+
""

yes ?yes? did I do it.. I really don't know JS : (
just guessing...

BTW .. thanks for your help!
Lou.



- Original Message - 
From: "Chasecreek Systemhouse" <[EMAIL PROTECTED]>
To: "Luinrandir Hernsen" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, November 04, 2004 8:27 PM
Subject: Re: screen size...


> On Thu, 4 Nov 2004 10:48:12 -0500, Luinrandir Hernsen
> <[EMAIL PROTECTED]> wrote:
> > It there a way to get the screen size info using perl?
>
> As a CGI, not really.  Try:
>
> 
> 
> toolkit = java . awt . Toolkit . getDefaultToolkit ();
> screensize = toolkit . getScreenSize ();
> document . writeln
> (
> "<p>" +
> "You screen is " + screensize . width + " pixels wide." +
> "</p>"
> );
> document . writeln
> (
> "<p>" +
> "You screen is " + screensize . height + " pixels tall." +
> "</p>"
> );
> 
> 
> 
>
>
> HOWEVER, The remote client must have JS enabled and have Java installed
=/
>
> -- 
> WC -Sx- Jones
> http://youve-reached-the.endoftheinternet.org/
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: screen size...

2004-11-04 Thread Chasecreek Systemhouse
On Thu, 4 Nov 2004 22:03:01 -0500, Luinrandir Hernsen
<[EMAIL PROTECTED]> wrote:
> Ok.. now how do I get the screen size info to a hidden input (in a form) or
> send back to a cgi ?

Um, well, that depends upon wat you want.  See attached for an example.

-- 
WC -Sx- Jones
http://youve-reached-the.endoftheinternet.org/


scrn.cgi
Description: Binary data
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


Re: screen size...

2004-11-04 Thread Chasecreek Systemhouse
On Thu, 4 Nov 2004 10:48:12 -0500, Luinrandir Hernsen
<[EMAIL PROTECTED]> wrote:
> It there a way to get the screen size info using perl?

As a CGI, not really.  Try:



toolkit = java . awt . Toolkit . getDefaultToolkit ();
screensize = toolkit . getScreenSize ();
document . writeln
(
"

" + "You screen is " + screensize . width + " pixels wide." + "

" ); document . writeln ( "

" + "You screen is " + screensize . height + " pixels tall." + "

" ); HOWEVER, The remote client must have JS enabled and have Java installed =/ -- WC -Sx- Jones http://youve-reached-the.endoftheinternet.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: screen size question

2003-03-27 Thread Peter Kappus
Hi Lou,
Yes, as Jeff pointed out, if you're running it from a console,
system("stty -a") should give you the rows/columns and a bunch of other
usefull stuff.  If, however, you're talking about screen resolution and
you're running your script as a CGI and sending the results to a browser
(which is what this list is all about ;-)  Then you're going to have to do
some fancy JavaScripting to capture the screen resolution, etc.

Basically, you create hidden form fields in a form on your page and then use
javascript to populate them once the page gets rendered on the client's
side.  (Un)fortunately, the only way to get this info is when the client
submits a form.


for example, I might have a form on my login page that looks like this:





username: 

password: 



then in the header I'd need a js function "onSubmit" like this:



function doSubmit(){
var elements = document.forms.LoginForm.elements;
elements.ScreenWidth.value = window.screen.width;
elements.ScreenHeight.value = window.screen.height;
elements.ColorDepth.value = window.screen.colorDepth;

//some other form validation

//submit!
document.forms.LoginForm.submit();
}





In my CGI, I can capture this using the standard CGI params methods...

use GGI qw/:standard/;

print "Content-type: text/html\n\n";

print "screenWidth: " . param("ScreenWidth");
print "screenHeight: " . param("ScreenHeight");

etc...

NOTE:  this is untested and yes, I just ripped it off of "mailblocks.com" 

If this makes no sense, try to learn a little more about hidden form
variables and javascript firstthen figure out how to get it into your
CGI.


good luck,
-Peter


-Original Message-
From: Luinrandir Hernsen [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:08 AM

how do I find the current screen size of someone running my perl program?
many thanks
Lou

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: screen size question

2003-03-27 Thread Luinrandir Hernsen
Ok i tried it...
do I have to parse the info or what?
or do I set it up in an if/ifels/else ?
sorry if I sound dumb, but i'm just learning perl.
thanks
Lou



- Original Message -
From: "Jeff Westman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 3:16 PM
Subject: Re: screen size question


> system("stty -a") should get you what you want I don't know if perl
has
> anything 'built-in'.
>
>
> -JW
>
>
> --- Luinrandir Hernsen <[EMAIL PROTECTED]> wrote:
> > how do I find the current screen size of someone running my perl
program?
> > many thanks
> > Lou
>
>
> __
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: screen size question

2003-03-27 Thread Jeff Westman
system("stty -a") should get you what you want I don't know if perl has
anything 'built-in'.


-JW


--- Luinrandir Hernsen <[EMAIL PROTECTED]> wrote:
> how do I find the current screen size of someone running my perl program?
> many thanks
> Lou


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]