"Martin Towell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Hi everybody!
> >
> > Have somebody any idea how I could do something like that?
> >
> > <?
> >             settype($phpScreenWidth,  "string");
> >             settype($phpScreenHeight, "string");
> > ?>

This is a serverside process

This says the var $phpScreenWidth and the var $phpScreenHeight are to be
strings.

At this point they have no value associated with them.

This is done on your server, *before* the page is given to the user...


> > <script language="javascript">
> >             var phpScreenWidth, phpScreenHight;
> >
> >             phpScreenWidth  = screen.width;
> >             phpScreenHeight = screen.height;
> >
> > </script>

This is a clientside process

This retrieves the width and height of the users browser window and drops
that value into 2 JavaScript variables.

This is done on the clinets browser, *after* the page is given to the
user...


> > <?
> >             echo "Width:|".$phpScreenWidth."|<br>";
> >             echo "Height:|".$phpScreenHeight."|<br>";
> > ?>

This is a serverside process

this displays the values of the vars $phpScreenWidth and $phpScreenHeight.

This varaibles do *not* have any values.

This is done on your server, *before* the page is given to the user...



> > I know that this code is not working, it is just to see what I want to
> > do.

ASSUPTION: all 3 sections are on the same PHP page to be servered.

Section #1 and #3 will be processed on the server *before* the page is given
to the user.

Section #2 will be processed on the clients browser *after* the page is
given to the user.


Your trying to clean the dinner dishes *before* you've set the table for
dinner.

It looks like you want to know the width and height of the clients browser
window.

And you want your PHP process to know this so it can do some magic.

Well, first your going to have to serve up a page that retrieves that info,
via JavaScript, places that info in 2 HIDDEN form objects, SUBMIT that info
back to your PHP process and pull that data from the POST variables.

*Then* you can do your magic in PHP with these values.

Or, you can translate your magic into JavaScript and let JS do your magic on
the clients browser.

Does this help you?

Walter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to