So im trying to make a security page. This security page will check to see if Flash or Java is enabled, and if it is, it will lead a user to another page.
I first thought of using Javascript to achieve this but the results were not what I expected:
if (navigator.javaEnabled())
{
<?php header('Location: http://www.google.com/'); ?>
}
else
{
<?php header('Location: http://www.yahoo.com/'); ?>
}
I tried this within Chrome and Firefox and they always redirect to yahoo. I enabled the Java plug-in in Firefox (I had it disabled before this test) and restarted the browser, same results.
Its weird because before it always took me to google, even if Java was disabled. I just need a good way to detect if Java is allowed, I dont want to run any applet.
Ive been seeing around other people may have the same problem. I cant contact http://www.java.com because my host does not allow outbound connections.
Thanks!
On client side, in javascript, you can solve this. When you detect that java is enabled you can set
window.locationto redirect your user to another page.