For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2004 > screen size...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author screen size...
Luinrandir Hernsen

2004-11-04, 8:55 pm

It there a way to get the screen size info using perl?
Lou
Chasecreek Systemhouse

2004-11-05, 3:55 am

On Thu, 4 Nov 2004 10:48:12 -0500, Luinrandir Hernsen
<luinrandir@luinrandir.com> wrote:
> It there a way to get the screen size info using perl?


As a CGI, not really. Try:

<blockquote><table border=3 bgcolor=#000000><tr><td>
<script>
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>"
);
</script>
</td></tr></table>
</blockquote>


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

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

2004-11-05, 3:55 am

On Thu, 4 Nov 2004 22:03:01 -0500, Luinrandir Hernsen
<luinrandir@luinrandir.com> 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/

Luinrandir Hernsen

2004-11-05, 8:55 am

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

"<p>" +
"<A HREF='game.cgi?W= " + screensize . width + "$H=" screensize . height
"'>click here</A>"+
"</p>"

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

BTW .. thanks for your help!
Lou.



----- Original Message -----
From: "Chasecr Systemhouse" <chasecr.systemhouse@gmail.com>
To: "Luinrandir Hernsen" <luinrandir@luinrandir.com>;
<beginners-cgi@perl.org>
Cc: <jaxlug-list@jaxlug.org>
Sent: Thursday, November 04, 2004 8:27 PM
Subject: Re: screen size...


> On Thu, 4 Nov 2004 10:48:12 -0500, Luinrandir Hernsen
> <luinrandir@luinrandir.com> wrote:
>
> As a CGI, not really. Try:
>
> <blockquote><table border=3 bgcolor=#000000><tr><td>
> <script>
> 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>"
> );
> </script>
> </td></tr></table>
> </blockquote>
>
>
> HOWEVER, The remote client must have JS enabled and have Java installed

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


Sean Davis

2004-11-05, 8:55 am


On Nov 4, 2004, at 10:03 PM, Luinrandir Hernsen wrote:
[color=darkred]
> 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
>
> "<p>" +
> "<A HREF='game.cgi?W= " + screensize . width + "$H=" screensize .
> height
> "'>click here</A>"+
> "</p>"
>
> yes ?yes? did I do it.. I really don't know JS : (
> just guessing...
>
> BTW .. thanks for your help!
> Lou.
>
>
>
> ----- Original Message -----
> From: "Chasecr Systemhouse" <chasecr.systemhouse@gmail.com>
> To: "Luinrandir Hernsen" <luinrandir@luinrandir.com>;
> <beginners-cgi@perl.org>
> Cc: <jaxlug-list@jaxlug.org>
> Sent: Thursday, November 04, 2004 8:27 PM
> Subject: Re: screen size...
>
>

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:

<form name="anotherName">
<input type=hidden name="hiddenName" value="initial">
</form>

<script language="JavaScript"><!--
document.write(document.anotherName.hiddenName.value+'<br>');
document.anotherName.hiddenName.value = 'hello world';
document.write(document.anotherName.hiddenName.value+'<br>');
//--></script>

I found this on:
http://developer.irt.org/script/form.htm

Hope this does what you want.

Sean

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com