Actually, what you want to do is possible, but difficult.$color = "<script><!-- document.write(screen.colorDepth) //--> </script>";
$query = mysql_query("select id from color where color = '$color' "); $a = mysql_num_rows($query);
If you are willing to tolerate a page refresh, you can use this code to implement this function:
<html>
//header
<?php
if (empty($_GET['color'])){
?>
<body onLoad="document.aform.color.value=screen.colorDepth; document.aform.submit(); return true;">
<form name=aform action=<?php echo $_SERVER['PHP_SELF']; ?> method=get>
<input type=hidden name=color>
</form>
<?php
exit();
} // if
else{
$color = $_GET['color'];
$query = mysql_query("select id from color where color = '$color' ");
$a = mysql_num_rows($query);
<?php
<body>
?>
} // else
// rest of page
I'm not sure that this particular script will work, but I think that this method is the best way to have javascript send things to php.
Hope this helps, Grant
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php