日期:2014-05-17 浏览次数:20478 次
<html> <script> function createAjax(){ var Ajax=false; if(window.XMLHttpRequest){ //非IE系列,符合W3C标准,或者是IE7,IE8 Ajax=new window.XMLHttpRequest(); if(Ajax.overrideMimeType){ Ajax.overrideMimeType("text/xml"); } }else if(window.ActiveXObject){ //IE系列的低版本 var version=['Microsoft.XMLHTTP','MSXML.XMLHTTP','Msxml2.XMLHTTP.7.0','Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP']; for(var i=0;i<version.length;i++){ try{ Ajax=new ActiveXObject(version[i]); if(Ajax){ return Ajax; } } catch(e){ Ajax=false; } } } return Ajax; } var Ajax=null; function show(){ Ajax=createAjax(); Ajax.open("post","server.php?name=tianxiaokang&age=22&"+Math.random(),ture); Ajax.send(null); } </script> <input type="button" onclick="show()" value="请求"> </html>
<?php $str=$_GET["name"]; $str.="*******"; $str.=$_GET["age"]; $file=fopen("save.txt","a"); fwrite($file,$str); fclose(); ?>