PHP完全自学手册(珍藏版) 中文pdf扫描版下载
html文档 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>测试</title> <script src='http://www.kuitao8.com/images/js/jquery-1.9.1.min.js'></script> </head> <body> <script> $(function(){ $.post('test.php',{uesername:'admin',password:'123456a'},function(data){ alert(data); }) }) </script> </body> </html> test.php的页面 <?php $file ="./log.txt"; $array = $_POST; //调试的方法 file_put_contents($file, "<?php\nreturn " . var_export($array, true) . ";"); echo "处理完毕"; ?> log.txt内容 <?php return array ( 'uesername' => 'admin', 'password' => '123456a', );
转载请注明:谷谷点程序 » php调试jquery ajax的简单实现方法