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);
相关文档:
语法: boolean session_register(string name);
注册新的变量。
返回值: 布尔值
函数种类: 资料处理
内容说明
本函数在全域变量中增加一个变量到目前的 Session 之中。参数 name 即为欲加入的变量名。成功则返回 true 值。
假如在头文件,开启session,即使用session_start()函数后面加上session_register(string na ......
以下都是转载, 简单说下, php是不支持多线程的。。。。
PHP语言本身是不支持多线程的. 总结了一下网上关于PHP模拟多线程的方法, 总的来说, 都是利用了PHP的好伙伴们本身所具有的多线程能力. PHP的好伙伴指的就是LINUX和APACHE啦, LAMP嘛.
另外, 既然是模拟的, 就不是真正的多线程. 其实只是多进程. 进程和线程是 ......
首先我们要介绍一下我们在这篇文章中使用的PHP类Libchart,这是个外国人(非中国国籍的地球人,被称为外国人!)写的免费类!使用起来非
常简单。看出来了吧,我们是要用一个外国人写的PHP创建柱状图,饼状图,和线性图的类,来工作的。如果你要学习这个类的写法,你也可以把这个类下载下来看看外国人的思路!
我们开始吧 ......
[root@BIND9-master /usr/local/bin]# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/Zend/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed: &n ......