易截截图软件、单文件、免安装、纯绿色、仅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中全面阻止SQL注入式攻击之三

一、 建立一个安全抽象层
  我们并不建议你手工地把前面介绍的技术应用于每一个用户输入的实例中,而是强烈推荐你为此创建一个抽象层。一个简单的抽象是把你的校验方案加入到一个函数中,并且针对用户输入的每一项调用这个函数。当然,我们还可以创建一种更复杂的更高一级的抽象-把一个安全的查询封装到一个类中,从而应 ......

php 不支持中文文件名的处理

最近写一个关于读取中文文件名的小CASE中遇到了不PHP不支持中文文件名的问题
我的环境:
WINDOWS+Appach +mysql
php页 MYSQL均为编码UTF-8
解决方法如下:
在MYSQL中取出的中文文件名转换其编码
$fileName=iconv("UTF-8","GBK",$fileName); ......

PHP下载CSS文件中的图片

作为一个资深并且专业的扒皮人员,在我从初三开始投入伟大的互联网中到现在积累了丰富的扒皮经验。我相信每个做web的程序员也都会有类似的经历。
在扒皮过程中,必不可少的需要下载样式文件中的图片。碰到比较庞大的样式文件,其中可能会有上百个需要下载的图片,那么使用下面这段小代码是最为合
适的了。
< ?php
/* ......

PHP程序员最易犯10种错误(转载)


PHP是个伟大的web开发语言,灵活的语言,但是看到php程序员周而复始的犯的一些错误。我做了下面这个列表,列出了PHP程序员经常犯的10中错误,大多数和安全相关。看看你犯了几种:
1.不转意html entities
一个基本的常识:所有不可信任的输入(特别是用户从form中提交的数据) ,输出之前都要转意。
echo $_GET['usenam ......

apache 和php 安装配置

先安装apache http server   一路next;
再安装php,注意选择 Apache 2.2.x Module;
安装结束以后,还需要修改 Apache 的配置文件。文件路径为
C:\Program Files\Apache
Software Foundation\Apache2.2\conf\httpd.conf。
用 Notepad 打开
httpd.conf,在文件最后有以 #BEGIN PHP INSTALLER EDITS - RE ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号