惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cloudbric
Cloudbric
P
Palo Alto Networks Blog
T
Threatpost
T
Tor Project blog
T
Tenable Blog
AWS News Blog
AWS News Blog
Project Zero
Project Zero
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Latest
Security Latest
云风的 BLOG
云风的 BLOG
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
MongoDB | Blog
MongoDB | Blog
aimingoo的专栏
aimingoo的专栏
K
Kaspersky official blog
Jina AI
Jina AI
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
IT之家
IT之家
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
Y
Y Combinator Blog

博客园 - Stym--闫生

最简单的silverlight的DataGrid行双击事件添加 == 在cmd命令下imp oracle dmp文件 flex TabNavigator 切换之前给出提示 - Stym--闫生 vb.net连接oracle和php连接oracle - Stym--闫生 - 博客园 数据库名,全局数据库名,SID 创建同义词和赋权限 linux下创建硬连接 flex 的as文件引用,包引用 - Stym--闫生 - 博客园 flex分页控件 - Stym--闫生 - 博客园 数据处理:等待条 把数组转化成一个xml字符串--php - Stym--闫生 - 博客园 javascript拖住布局demo flex + Amfphp + mysql +IIS 5.1t 用sql查看表结构 c#生成验证图片 C#使用sql语句读取excel文件数据 svn切换用户,报“501 Method Not Implemented”错误 div滤镜结合ajax,实现登录
php使用ajax技术
Stym--闫生 · 2008-11-25 · via 博客园 - Stym--闫生

一:html文件(yans.html)

<META http-equiv=content-type content='text/html; charset=utf-8'/>
<META http-equiv=pragma content=no-cache>
<META http-equiv=expires content=0>
</HEAD>
<BODY>
 <input type="button"  name="TEST"  value =" click" onClick="post();">
</BODY>
<script language="javascript" type="text/javascript">
 
 //处理send_request返回信息的函数,使用AJAX时统一调用此函数
 var http,http_return;
 function checkRequest() {
  if (http.readyState==4 && http.status==200) { // 判断对象状态,信息已经成功返回,开始处理信息
   http_return = http.responseText;
  }
 }
 function post()
 {
  try{
   http= new ActiveXObject("Msxml2.XMLHTTP");
  }catch(e)
  {
   try{
    http= new ActiveXObject("Microsoft.XMLHTTP");
   }catch(e)
   {
    alert("create requestHTTP false!");
    return ;
   }
  }
  // escape(),encodeURI();
  http.open("POST","AJax.php?name="+encodeURI("闫生"),true);

  //只有是post提交的时候使用,下面一句话。get不要
  http.setRequestHeader('Content-type','application/x-www-form-urlencoded');
  http.onreadystatechange = checkRequest;

  // 这句话话如果是get提交的话,就发送null即可

 // post提交的时候,相当于提交一个form
  http.send("sex=按钮");
  alert(http_return);
 }
</script>
</HTML>

二:ajax文件(AJax.php)

<?php
function fn_getParam($sSource,$sReplace="")
  {
    $sValue="";
    if (isset($_GET[$sSource])) {
        $sValue = $_GET[$sSource];
    } else if (isset($_POST[$sSource])) {
        $sValue = $_POST[$sSource];
    }
    if (is_null($sValue) || $sValue=="") {
        return $sReplace;
    }
    return $sValue;
  }
$a = fn_getParam('name','yans');
// 打开文件,获得句柄
$handle = fopen('test.txt', 'w+');
// 写入文件
fwrite($handle,$a);

// 关闭文件
fclose($handle);

// 返回ajax操作结果。
echo $a;
?>