Hej
Kan nogen se hvorfor disse 2 script ikke spiller?
Indholg af "index.php":
<HTML>
<head>
<title>Detection</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- begin
function display() {
window.onerror=null;
colors = window.screen.colorDepth;
document.form.color.value = Math.pow (2, colors);
if (window.screen.fontSmoothingEnabled == true)
document.form.fonts.value = "Yes";
else document.form.fonts.value = "No";
document.form.navigator.value = navigator.appName;
document.form.version.value = navigator.appVersion;
document.form.colordepth.value = window.screen.colorDepth;
document.form.width.value = window.screen.width;
document.form.height.value = window.screen.height;
document.form.maxwidth.value = window.screen.availWidth;
document.form.maxheight.value = window.screen.availHeight;
document.form.codename.value = navigator.appCodeName;
document.form.platform.value = navigator.platform;
if (navigator.javaEnabled() < 1) document.form.java.value="No";
if (navigator.javaEnabled() == 1) document.form.java.value="Yes";
if(navigator.javaEnabled() && (navigator.appName != "Microsoft Internet
Explorer")) {
vartool=java.awt.Toolkit.getDefaultToolkit();
addr=java.net.InetAddress.getLocalHost();
host=addr.getHostName();
ip=addr.getHostAddress();
alert("Your host name is '" + host + "'\nYour IP address is " + ip);
}
}
// end -->
</script>
</head>
<BODY OnLoad="display()">
<form method="POST" action="save_info.php" name="form">
<input type=hidden name=width>
<input type=hidden name=height>
<input type=hidden name=navigator>
<input type=hidden name=maxwidth>
<input type=hidden name=maxheight>
<input type=hidden name=version>
<input type=hidden name=colordepth>
<input type=hidden name=codename>
<input type=hidden name=platform>
<input type=hidden name=color>
<input type=hidden name=java>
<input type=hidden name=fonts>
</form>
</body>
</html>
Indhold af "save_info.php"
<?php
include("dbconnect.inc");
$insertSQL = sprintf("INSERT INTO detection (width, height, navigator,
maxwidth, maxheight, version, colordepth, codename, platform, color, java,
fonts) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',
'%s', '%s')", addslashes($width), addslashes($height),
addslashes($navigator), addslashes($maxwidth), addslashes($maxheight),
addslashes($version), addslashes($colordepth), addslashes($codename),
addslashes($platform), addslashes($color), addslashes($java),
addslashes($fonts));
mysql_query($insertSQL);
echo mysql_error();
?>
VH
Anders Thingholm
|