ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-france
php-france
Re: [php-france] Récupération de la résolution écran du client
by BibiLefou other posts by this author
Nov 9 2002 2:30AM messages near this date
Re: [php-france] =?ISO-8859-1?Q?R=E9cup=E9ration_de_la_r=E9?= =?ISO-8859-1?Q?solution_=E9cran_du_client?= | Re: [php-france] =?ISO-8859-1?Q?R=E9cup=E9ration_de_la_r=E9?= =?ISO-8859-1?Q?solution_=E9cran_du_client?=
charlies tapotait:

>  Ok alors pourquoi le print correspondant à la condition ne s'affiche
>  pas chez moi ?
> 
>  Pour mieux comprendre voici la charte. hormis l'erreur sur la ligne
>  95.
> 
>  Dans mon cas tu verras, il y a deux lignes horizontales tres proche et
>  normalement la valeur correspondante a l'appel devrait s'afficher.
>  http://212.198.70.236/sog/
> 
>  Sur ce bonne nuit car la je tombe.

La fonction JS est définie dans l'entête du document HTML. Ensuite, on
l'appelle lors du chargement de la page avec le petit code
onload="javascript:checkResolution()".

Tu avais oublié de mettre "?> " à la fin de ton code PHP, du coup lors de
l'exécution du script, ça ne risque pas de tourner pour un sous.

Tiens l'exemple en entier regarde bien l'imbrication et l'appel de la
fonction :
--------------------
<head> 
<SCRIPT LANGUAGE="JavaScript"> 
<!--
function checkResolution() {
document.location="<?php echo $PHP_SELF
?> ?w="+screen.width+"&h="+screen.height;
}
//--> 
</SCRIPT> 
</head> 
<body onload="javascript:checkResolution()"> 
<?php
if(($w> ="262") && ($w<="592")) { print"320x240"; }
elseif(($w> ="592") && ($w<="702")) { print"640x480"; }
elseif(($w> ="702") && ($w<="922")) { print"800x600"; }
elseif(($w> ="922") && ($w<="1142")) { print"1024x768"; }
elseif(($w> ="1142") && ($w<="1252")) { print"1152x864"; }
elseif(($w> ="1252") && ($w<="1582")) { print"1280x1024"; }
elseif(($w> ="1582") && ($w<="1692")) { print"1600x1200"; }
elseif(($w> ="1692") && ($w<="1692")) { print"1792x1344"; }
elseif(($w> ="1692") && ($w<="1802")) { print"1800x1440"; }
elseif ($w> ="1802") { print"1832x1392"; }
?> 
-------------------

Voilà, @+
Aller, au lit ! :-I
____________________
  SysMik
  http://www.sysmik.net
Thread:
charlies
BibiLefou
charlies
BibiLefou
charlies
BibiLefou
charlies
lulu
Tanguy Crollen
Tanguy Crollen
lulu
Tanguy Crollen
lulu
Olivier Meunier
BibiLefou
Didier DEMAISON

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved