You are here: Re: use a javascript variable in php? « PHP Programming Language « IT news, forums, messages
Re: use a javascript variable in php?

Posted by Niklas Sch�nberg on 06/29/05 05:53

mbasil7 wrote:
> Hi at all!
>
> I want to use a javascript variable in php. The reason is that i want
> to know the client's screen resolution.

How about this:

--- Code ---
<?php
if (!isset($width) || !isset($height))
echo "<script type='text/javascript'>
document.location='index.php?width='+screen.width+'&height='+screen.height;
</script>";

echo "$width X $height";

?>
--- End Code ---

I don't have the ability to test it right now, so don't bash me too much
if it doesn't work. However the idea should be pretty sound.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация