php 的 ajax 实现
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<input type="button" onclick="test();" value="提交"/>
<script type="text/javascript">
function test(){
var valid = {
username: 'taoge',
password: '123456'
};
$.ajax({
url: 'valid.php',
type: 'get',
data: valid, // 发送的数据
dataType: 'json', // 发送/接收数据的格式
success: function(data){
alert(""+data.username);
},
error: function(data){
alert("xxx"+data);
}
});
}
</script>
===========================
valid.php
相关文档:
jquery通过post传递数据到服务器(不使用插件):
<html>
<head>
<title>Untitled Page</title>
<script language="javascript" type="text/javascript" src="js/jquery-1.3.1.js"></script>
<script language="ja ......
原文链接:http://www.williamlong.info/archives/1846.html
在Windows IIS
6.0下配置PHP
,通常有CGI
、ISAPI
和FastCGI
三种配置方式,这三种模式都可以在IIS
6.0下成功运行,下面我就讲一下这三种方式配置的区别和性能上的差异。
1、CGI
(通用网关接口/Common Ga ......
最近在Greg Beaver's的blog上发表的一篇新文章 comparing strings in PHP with the == operator 中提及了PHP的 == 运算符在对字符串进行比较时值得注意的问题。
在某些情况下,PHP会把类数值数据(如含有数字的字符串等)转换成数值处理,== 运算符就是其中之一。在使用 == 运算符对两个字符串进行松散比较时,PHP会把类数 ......
require() 与 require_once()
通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 require
所指定引入的文件,如果出现错误是致命的。
nclude() 与 include_once()
&n ......
checkcode.php
====================
<?php
session_start();
$funcs = array('imagecreatetruecolor','imagecolorallocate','imagefill','imageline','imagedestroy','imagecolorallocatealpha','imageellipse','imagepng');
if(!function_exists('ob_gzhandler'))
ob_clean();
//crea ......