Detect Java Runtime & Windows Permssions

B

Barkster

I am using the following code to install JRE automatically when they
browse my applet but I found today and issue when a user does not have
permission to install applications they do not even get prompted to
install JRE and they are given a red x icon with no warning. How can I
detect if this either automatic load failed then redirect to install
page or just redirect if they do not have JRE installed? Thanks.

<?php
$useApplet = 0;
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (stristr($user_agent, "konqueror") || stristr($user_agent,
"macintosh") || stristr($user_agent, "opera")) {
$useApplet = 1;
echo '<applet code = "com/applet/upload/ImageUpload.class"
archive = "java/Applet.jar"
name = "Image Uploader"
width = "620"
height = "535"
hspace = "0"
vspace = "0"
align = "middle">';
} else {
if (strstr($user_agent, "MSIE")) {
echo '<object
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width= "620"
height= "535" style="border-width:0;" id="zupload" name="zupload"
codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#version=1,4,1">';
} else {
echo '<object type="application/x-java-applet;version=1.4.1"
width= "620" height= "535" id="zupload" name="zupload">';
}

echo '<param name="archive" value="java/Applet.jar">
<param name="code" value="com/applet/upload/ImageUpload.class">
<param name="name" value="Image Uploader">';
}

if ($useApplet == 1) {
echo '</applet>';
} else {
echo '</object>';
}

?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top