Autor | Zpráva | ||
---|---|---|---|
exColor Profil * |
#1 · Zasláno: 12. 5. 2008, 17:07:58
Ahoj,
chtel bych se zepta jestli muzu nejak v PHP zjistit rozliseni monitoru...vsechno co jsem na googlu nachazel, vedlo ke zjisteni rozliseni prej Javascript. Potreboval bych tu hodnotu (treba 1024x768) ukladat do databaze a to bych musel zrejme nejak skloubit javascript s php promennymi a bylo by to zbytecne slozite. Proto se pta zda to lze ciste v PHP nejak zjistit. Predem diky |
||
Nox Profil |
#2 · Zasláno: 12. 5. 2008, 17:10:57
Podle mě určitě ne, už z podstaty PHP jakožto serverového skriptu...jedině + JS jak píšeš
|
||
exColor Profil * |
#3 · Zasláno: 12. 5. 2008, 21:19:26
tak kdyz lze zjistit prohlizec a OS, tak jsem si myslel ze by slo i nejak zjistit rozliseni monitoru, ale diky za odpoved.
|
||
Medvídek Profil |
#4 · Zasláno: 12. 5. 2008, 21:21:57 · Upravil/a: Medvídek
vsak muzes ulozit v JS rozliseni a nasledne ulozit do databaze.
Nekdy daavno jsem myslim pouzik neco podobnyho tomuto: index.php: $BaseHref = http://server.nekde.cz/ ---------------- stats/counter.php?referer=" + escape(top.document.referrer) + "&screenres=" + screen.width + "x" + screen.height + "&colordepth=" + screen.colorDepth + "\" width=\"1\" height=\"1\" alt=\"\" border=\"0\">"); // --> stats/counter.php" width="1" height="1" alt="" border="0"> ---------------- counter.php: ---------------- // ROZLIŠENÍ if (isset($_GET['screenres'])){ $screenres = $_GET['screenres']; } $query = MySQL_Query("SELECT id FROM {$stats_prefix}resolution WHERE screenres = '$screenres'"); if ($result = MySQL_Fetch_Array($query)) $resolution = $result['id']; else $resolution = 0; // BAREVNÁ HLOUBKA if (isset($_GET['colordepth'])){ $colordepth = $_GET['colordepth']; } $query = MySQL_Query("SELECT id FROM {$stats_prefix}colordepth WHERE depth = '$colordepth'"); if ($result = MySQL_Fetch_Array($query)) $depth = $result['id']; else $depth = 0; . . . . $add = MySQL_Query("INSERT INTO access VALUES ('', '$date', '$visit', '$browser', '$os', '$resolution', '$depth', '$referer', '$path', '$area', '$ip', '$ip_name', '$domain')"); |
||
echo Profil * |
#5 · Zasláno: 12. 5. 2008, 21:45:16
ja pouzivam na zistenie rozlisenia screnu takuto kombinaciu:
<? if(isset($_COOKIE["screen_resolution"])) { $screen_res = $_COOKIE["screen_resolution"]; } else { //means cookie is not found set it using Javascript ?> <script language="javascript"> <!-- writeCookie(); function writeCookie() { var today = new Date(); var the_date = new Date("December 31, 2023"); var the_cookie_date = the_date.toGMTString(); var the_cookie = "screen_resolution="+ screen.width +"x"+ screen.height; var the_cookie = the_cookie + ";expires=" + the_cookie_date; document.cookie=the_cookie location = 'index.php'; } //--> </script> <? } ?> premenna $screen_res obsahuje informaciu o rozliseni |
||
echo Profil * |
#6 · Zasláno: 12. 5. 2008, 21:49:40
samozrejme tento skript musi byt umiestneny v hlavicke html pretoze nastavuje cookie
|
||
srigi Profil |
#7 · Zasláno: 13. 5. 2008, 09:53:51
Medvidek >> opat raz zase vidno predanie $_GET[] priamo do MySQL dotazu. Pozor na to.
|
||
Časová prodleva: 16 let
|
0