I would like to detect whether java is enabled in the user's browser when they use my website(php).
If java is enabled a certain div loads on the website if not another div loads.
I do the following:
in the PHP header file: (so whatever loads it checks whether java is enabled)
<?php $no_java=0;?>
<noscript><input type="image" src="whatever.jpg" id="java_checker" value="1"></noscript>
This a 1px by 1px transparent image which can't be seen but it's better than a text box which can be seen.
if(java_checker==1){
$no_java=1;
}else{
$no_java=1
}
I've been programming in PHP for a few months now. I know that the if(java_checker==1)
is not right but I don't know how to check the value without submitting a form etc...
Anyone could tell me how to do it? the value="<?php $no_java=1;?>"
is not good because the php part seems to load regardless to the <noscript>
tags :(
Any idea? Or any other idea how I could "tell" php that there is no java so do whatever...