|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm trying to incorporate PHP and Javascript so I can log visitors screen width/height and color depth. In order to do this..well just look at the code. It isn't working I have to find some way to get the javascript output into a variable in PHP.
<script language="javascript"> $linea = "document.write(screen.Width)" document.write("<? $width=" $linea "?>"); </script> <? $ip = getenv('REMOTE_ADDR'); $browser = getenv('HTTP_USER_AGENT'); $file = getenv('REQUEST_URI'); mysql_query("INSERT INTO commaflex (visitor_ip, visitor_info, visitor_page, visitor_width, visitor_height, visitor_color) VALUES ('$ip', '$browser', '$file', ?> ..any suggestions? |
|
#2
|
|||
|
|||
|
This will work. It is a little bit more code than I like but it works
![]() <script language="javascript"> linea = screen.Width if (linea=="480"){ <?php $width="480" ?> } if (linea=="600"){ <?php $width="600" ?> } // and so on </script> <?php echo $width ?> ------------------ 2 Samuel 7:10 Moreover I will appoint place for my people Israel, and will plant them, that they may dwell in a place of their own, and move no more; neither shall the children of wickedness afflict them any more, as beforetime, |
|
#3
|
|||
|
|||
|
my code should work. I guess I did something wrong withe the $width="480" or something
I don't know see if you can build off of it. ------------------ 2 Samuel 7:10 Moreover I will appoint place for my people Israel, and will plant them, that they may dwell in a place of their own, and move no more; neither shall the children of wickedness afflict them any more, as beforetime, |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Bill Gates Brain In A Jar |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|