PHP get javascript var

admin

Administrator
Staff member
I need to get the browser version from JavaScript to PHP

I need this to make a small rule which prints the style propperties only when the browser is IE4 or higher... because NS4 doesn't support them and destroys the layout when shown in NS4. I got already a JavaScript which tells which browser your looking with... I need only to pass that to the PHP var $browser

something like this any where in the code:

var $browser = (the_value_from_JavaScript)

and then:

<input type=button value=submit onclick="action();" <? if($browser==IE4||$browser==NS6) {print('style=\"background: #00000; whatever:blabla;\"'); } ?> >Can't you just grab the variable using PHP? Something like:

$HTTP_USER_AGENT


Regards,
Kevinyes that's possible too :)

I'll try that... (one step closer to NS compatible photogallery...)

want to see a demoversion?... <!-- m --><a class="postlink" href="http://www.secretsound.f2s.com/legalize2000/">http://www.secretsound.f2s.com/legalize2000/</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.secretsound.f2s.com/mh28052001/">http://www.secretsound.f2s.com/mh28052001/</a><!-- m -->

for the source goto:
<!-- m --><a class="postlink" href="http://www.phpfreakz.com">http://www.phpfreakz.com</a><!-- m --> [script libary] > [ezview]

(to bad it's only in dutch but do not fear... just grap the script... put it in a dir. with images and run the file... everything else goes automatic)Hey...thats pretty neat :)

Kevin
 
Back
Top