星星评价代码,怎样获取本次点击打分的分值将它存储到数据库中?(求指教)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
<title>星星评价</title>
<style type="text/css">
#zzjs_net{position:relative;width:150px;height:30px;background:url(img/starrate.gif);overflow:hidden;cursor:pointer;}
#defaultStars{width:100%;height:100%;background:url(img/starrate.gif) no-repeat;}
#zzjs_net ul{list-style:none;margin:0;padding:0;position:absolute;top:0;left:0;}
#zzjs_net li{width:30px;height:30px;float:left;text-indent:-100px;overflow:hidden;}
</style>
<script type="text/javascript">
function $(id){return document.getElementById(id);}
window.onload = function(){
//box 为整个结构的最外层容器,由他来捕捉所有事件
var box = $("zzjs_net");
//默认级别,星星的变化都是通过这个层的背景图片的backgroundPosition 变化来实现
var defaultStars = $("defaultStars");
//获得设置的默认级别
var defaultValue = box.getAttribute("default");
var defaultPosition = defaultValue*30 - 150 + "px -30px";
defaultStars.style.backgroundPosition = defaultPosition;
box.onmouseover = function(e){
var src = e?e.target:event.srcElement;
if (src.tagName == "LI"){
var x = -150 + src.innerHTML*30;
defaultStars.style.backgroundPosition = x + "px -30px";
}
}//
box.onmouseout = function(e){
defaultStars.style.backgroundPosition = defaultPosition;
}
box.onclick = function(e){
var src = e?e.target:event.srcElement;
if (src.tagName == "LI"){
var x = -150 + src.innerHTML*30;
defaultStars.style.backgroundPosition = x + "px -60px";
//移除事件,让box不在对鼠标动作作出反映
box.onmouseover = box.onmouseout = box.onclick = null;
box.style.cursor = "default";
$("www_zzjs_net").innerHTML = "您投下的一票是:" +src.title + ",值是:" + src.innerHTML;
<?php $a=("www_zzjs_net").innerHTML;
echo $a;?>
}
}
}
</script>
</head>
<body>
<p id="www_zzjs_net"></p>
<div id="zzjs_net" default="3">
<div id="defaultStars"></div>
<ul>
<li title="很差">1</li>
<li title="不好">2</li>
<li title="一般">3</li>
<li title="还可以">4</li>
<li title="很好">5</li>
</ul>
</div>
</body>
</html>
------解决方案--------------------你可以不用显示的吧,星星别人就看的懂几级,你直