此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【zzxap】截止到2008-07-03 16:34:57的历史汇总数据(不包括此帖):
发帖的总数量:66 发帖的总分数:2350
结贴的总数量:59 结贴的总分数:2107
无满意结贴数:7 无满意结贴分:250
未结的帖子数:7 未结的总分数:243
结贴的百分比:89.39 % 结分的百分比:89.66 %
无满意结贴率:11.86 % 无满意结分率:11.87 %
楼主加油
楼主【zzxap】截止到2008-07-03 16:34:57的历史汇总数据(不包括此帖):
发帖的总数量:66 发帖的总分数:2350
结贴的总数量:59 结贴的总分数:2107
无满意结贴数:7 无满意结贴分:250
未结的帖子数:7 未结的总分数:243
结贴的百分比:89.39 % 结分的百分比:89.66 %
无满意结贴率:11.86 % 无满意结分率:11.87 %
楼主加油
接收页也全部改成$_GET[]
第二种办法是用POST方式,其他不变
试试
var url ="save.php?"
xmlHttp.open("POST",url,true);
xmlHttp.send("id"=id);
不知道这个能不能提交过去
xmlHttp.open("POST",url,true);
xmlHttp.send("id"=id);
xmlHttp.send("bookname"=bookname);这样一个个send过去吗?我在另外一个页面$id=$_POST['id']不能接收数据吗?
不能,你用的是get传值,却用Post方法提交,显然无值要么你就直接用表单提交,不要调用AJAX了,
{
var id=document.getElementById("id").value; if (id!="")
{
var url ="save.php"; //UTF-8下要用encodeURI
str = "id=" + "$_POST(id)";
str += "&bookname=$_POST(bookname)";
str += "&issuDate=$_POST(issuDate)";
str += "&price=$_POST(price)";
str += "&synopsis=$_POST(synopsis)";
str += "&Maker=$_POST(Maker)";
str += "&publisher=$_POST(publisher)";
xmlHttp.open("POST",url,true);
xmlHttp.onreadystatechange=UpdateData;request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");//post使用时的设定,必须加上。
request.send( str ); }else
{
alert("please write all!");
}}function UpdateData()
{
if(xmlHttp.readyState<4)
{
span.innerHTML="loading...";
} if(xmlHttp.readyState==4)
{
span.innerHTML=xmlHttp.responseText;
}
if (request.readyState == 4)
{ // If the request is finished
if (request.status == 200) // If it was successful
alert(request.responseText);
document.getElementById("container").innerHTML = request.responseText; // Display the server's response
}
}这样改行不行?
str += "&bookname=$_POST(bookname)";
str += "&issuDate=$_POST(issuDate)";
str += "&price=$_POST(price)";
str += "&synopsis=$_POST(synopsis)";
str += "&Maker=$_POST(Maker)";
str += "&publisher=$_POST(publisher)";改成以上思路正确,但也不能乱来.你在js代码里用$_POST?
请用js代码取表单值!看看 http://www.openjs.com/articles/ajax_xmlhttp_using_post.php
ajax用成熟的js库吧,比如yui,jquery之类的,或者考虑自己封装一下。
接收页也全部改成$_GET[]
POST方式,其他不变
var url ="save.php?"
xmlHttp.open("POST",url,true);
xmlHttp.send("id"=id);
这样可以省缺许多麻烦
改成这样还是不行啊
var id=encodeURI(encodeURI(document.getElementById("id").value));
var bookname=encodeURI(encodeURI(document.getElementById("bookname").value));
var issuDate=encodeURI(encodeURI(document.getElementById("issuDate").value)); var price=encodeURI(encodeURI(document.getElementById("price").value));
var synopsis=encodeURI(encodeURI(document.getElementById("synopsis").value));
var Maker=encodeURI(encodeURI(document.getElementById("Maker").value));
var publisher=encodeURI(encodeURI(document.getElementById("publisher").value));
var STR="id="+id+"&bookname="+bookname+"&issuDate="+issuDate+"&price="+price+"&synopsis="+synopsis+"&Maker="+Maker+"&publisher="+publisher;
其他类推
STR="id="+id+"&bookname="+bookname+"&issuDate="+issuDate+"&price="+price+"&synopsis="+synopsis+"&Maker="+Maker+"&publisher="+publisher;