易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP header() examples 完整代码


/*** Function: PHP header() examples (PHP)
**
Desc: Some examples on how to use the header() function of PHPYou find
a detailed tutorial at expertsrt.com (English) or at ffm.junetz.de
(German).These is also a good help about caching at web-caching.com.
**
Example: see below.
<br/><br/><b>Tip:</b>
You can use these sites to check your headers: <a
href="http://web-sniffer.net/">web-sniffer.net</a>,
<a
href="http://www.delorie.com/web/headers.html">delorie.com</a>
or <a
href="http://www.forret.com/projects/analyze/">www.forret.com</a>.
** Author: Jonas John
*/
// fix 404 pages:
header('HTTP/1.1 200 OK');
// set 404 header:
header('HTTP/1.1 404 Not Found');
// set Moved Permanently header (good for redrictions)
// use with location header
header('HTTP/1.1 301 Moved Permanently');
// redirect to a new location:
header('Location: http://www.example.org/');
// redrict with delay:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
// you could also use the HTML syntax:// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
// content language (en = English)
header('Content-language: en');
// last modified (good for caching)
$time = time() – 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
// header for telling the browser that the content
// did not get changed
header('HTTP/1.1 304 Not Modified');
// set content length (good for caching):
header('Content-Length: 1234');
// Headers for an download:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');


相关文档:

我的php验证码类


<?php
/*
 * Created on 2010-3-11
 * author:zhangfei
 *我的验证码类
 */
 session_start();
 class Check_Class{
  public $h_img ;
public $c_back ;
public $c_front ;
//构造函数
function Check_Class(){
$h_img  =  imagecreate(100,30);
......

PHP通过DOM操作XML

PHP XML操作类DOMDocument属性及方法
注意大小写一定不能弄错.
属性:
Attributes 存储节点的属性列表(只读)
childNodes 存储节点的子节点列表(只读)
dataType 返回此节点的数据类型
Definition 以DTD或XML模式给出的节点的定义(只读)
Doctype 指定文档类型节点(只读)
documentElement 返回文档的根元素(可读写)
fi ......

完整linux下php单服务器配置

操作系统CentOS 5.3
系统安装完成后,安装必要的包
yum install autoconf gcc gcc-c++ libjpeg libjpeg-level
libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs ......

php 魔法引用函数

PHP提供两个方便我们引用数据的魔法引用函数magic_quotes_gpc和magic_quotes_runtime,这两个函数如果在php.ini设置为ON的时候,就会为我们引用的数据碰到单引号'和双引号"以及反斜线 \ 是自动加上反斜线,帮我们自动转译符号,确保数据操作的正确运行,可是我们在php不同的版本或者不同的服务器配置下,有的magic_quotes_g ......

几种常用PHP连接数据库的代码

PHP连接数据库之PHP连接MYSQL数据库代码 < ?php   
$mysql_server_name='localhost'; 
//改成自己的mysql数据库服务器  
$mysql_username='root'; 
//改成自己的mysql数据库用户名  
$mysql_password='12345678'; 
//改成自己的mysql数据库密码 &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号