PHP+Ajax实现Tab效果
用Ajax实现Tab效果的
先创建
ajax.php,在其中输入如下代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 2_1</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
<!--
//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp = false;
//Check if we are using IE.
function creatXMLHttp(){
try
{
//If the Javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
}
catch (e)
{
//If not, then use the older active x object.
try
{
//If we are using Internet Explorer.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
}
catch (E)
{
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
xmlhttp = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}
}
function makerequest(serverPage, objID)
{
creatXMLHttp();
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
相关文档:
$_SERVER['PHP_SELF'] #当前正在执行脚本的文件名,与document root相关。
$_SERVER['argv'] #传递给该脚本的参数
$_SERVER['argc'] #包含传递给程序的命令行参数的个数(如果运行在命令行模式)。
$_SERVER['GATEWAY_INTERFACE'] #服务器使用的 CGI 规范的版本。例如,& ......
转自:http://www.w3school.com.cn/php/func_string_substr.asp
PHP substr() 函数
PHP String 函数
定义和用法
substr() 函数返回字符串的一部分。
语法
substr(string,start,length)
参数描述
string
必需。规定要返回其中一部分的字符串。
start
必需。规定在字符串的何处开始。
正数 - 在字符串的指定位置开 ......
真兄弟,讲义气,同甘苦,共进退。
《兄弟连》电影的上映,大家纷纷给出了好评。不就是一部战争片么,为何有如此强烈的响应?首先这是一部战争片并没错,但《兄弟连》电影更多的是洋溢着那种相濡以沫的兄弟情义,坚如磐石。多 ......
php cli命令行模式是WIN下的一个SHELL,不需要APACHE的支持就能执行PHP脚本的脚本,并且是持续执行的。这些特点很容易利用来快速测试PHP脚本。今天就特意找来一些资料,整理了一下,权当复习。
D:\AppServ\php5>php -help
Usage: php [options] [-f] <file> [--] [args...]
&nbs ......