שאלת PHP + שאלת דטאבייס

nirsalon

New member
שאלת PHP + שאלת דטאבייס

1. איך אני מקבל בתור משתנה את רזולוצית המסך ב PHP (אני יודע ש-פהפ היא שפת צד שרת ולכן זה יהיה מסובך. לא מצאתי אפשרות להעביר משתנים מ JS לPHP בדרכים נורמליות. שמעתי משהו על API ו GetSystemMatrix אבל לא הצלחתי למצוא מידע על יישום של זה.) 2. האם ישנה אפשרות לעדכן נתונים ב MSAcceess Database ב PHP? איך?
 

frommophir

New member
בעקרון, ניתן ב- JS לזהות מסך, ו...

הנה דוגמה איך להעביר את זה ל-PHP אחר כך:
<script language="javascript1.2"><!-- rz="na"; // Screen Rez cd="na"; // Color Depth bn=navigator.appName; // Browser Name if (bn.substring(0,9)=="Microsoft") { bn="MSIE"; // browser name, cont'd }; rz=screen.width+"*"+screen.height; // Screen Rez, cont'd cd=(bn=="MSIE")?screen.colorDepth:screen.pixelDepth; // Color depth if (cd=="undefined") { cd="na"; // Color depth, cont'd }; arg="<a href='output.php3?"; arg+="bn="+bn+"&rz="+rz+"&cd="+cd; arg+="'>Find your screen rez</a>"; document.write(arg); //--></script>​
ולגבי גישה ל- DB: ממליץ על הקישור הבא: http://www.php.net/manual/he/ref.odbc.php והנה דוגמה לגישה ל- MS ACCESS DB עם קישור DSN בקוד PHP:
<? # connect to a DSN "mydb" with a user and password "marin" $connect = odbc_connect("mydb", "marin", "marin"); # query the users table for name and surname $query = "SELECT name, surname FROM users"; # perform the query $result = odbc_exec($connect, $query); # fetch the data from the database while(odbc_fetch_row($result)){ $name = odbc_result($result, 1); $surname = odbc_result($result, 2); print("$name $surname\n"); } # close the connection odbc_close($connect); ?>​
בהצלחה.
 

nirsalon

New member
תודה, אבל...

1. אני לא מעונין לעבור דף, אלא לדעת את הרזולוציה תו"כ ריצת הדף כי אני צריך את הנתון בכל דף באתר. 2. התכוונתי לעדכן נתונים, לא להציג אותם. תודה..
 

DJ69

New member
אתה קורא אותו ממשתני המערכת

הם נימצאים ב $HTTP_ENV_VARS.
 
למעלה