您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Ajax与PHP

2025/9/22 7:30:51发布17次查看
js代码:
var xmlhttp=createxmlhttprequestobject(); //get xmlhttprequest object function createxmlhttprequestobject(){ var xmlhttp; if(window.activexobject){ try{ xmlhttp=new activexobject(microsoft.xmlhttp); } catch(e){ xmlhttp=false; } }else{ try{ xmlhttp=new xmlhttprequest(); } catch(e){ xmlhttp=false; } } if(!xmlhttp){ }else{ return xmlhttp; } } function process(){ if(xmlhttp.readystate==4||xmlhttp.readystate==0){ name=document.getelementbyid(myname).value; xmlhttp.open(get,quickstart.php?name=+name,true); xmlhttp. xmlhttp.send(null); }else{ settimeout('process()',1000); } } function handleserverresponse(){ if(xmlhttp.readystate==4){ if(xmlhttp.status==200){ xmlresp xmldocumentelement=xmlresponse.documentelement; hellomessage=xmldocumentelement.firstchild.data; document.getelementbyid('divmessage').innerhtml=''+hellomessage+''; settimeout('process()',1000); }else{ alert('there was a problem accessing hte server:'+xmlhttp.statustext); } } }
php代码:
遇到了 一个
warning: cannot modify header information - headers already sent by....
的问题。解决方法:
修改php.ini文件,
我用的是阿里的服务器所以
启用如下如的功能就可以了。

等),以防止出错。

以上就介绍了ajax与php,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product