PHP header() examples
//用这个header指令来解决URL重写产生的404 header
header('HTTP/1.1 200 OK');
// 页面没找到
header('HTTP/1.1 404 Not Found');
// 访问受限
header('HTTP/1.1 403 Forbidden');
// The page moved permanently should be used for
// all redrictions, because search engines know
// what's going on and can easily update their urls.
//页面被永久删除,可以告诉搜索引擎更新它们的urls
//PS:第一次碰到这个指令,不知道能不能用来把自己的站点从搜索引擎中删除呢?
header('HTTP/1.1 301 Moved Permanently');
// 服务器错误
header('HTTP/1.1 500 Internal Server Error');
// 重定向到一个新的位置
header('Location: http://www.example.org/');
// 延迟一段时间后重定向
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
// 也可以使用HTML语法来实现延迟
// zip"');
header('Content-Transfer-Encoding: binary');
// 加载要下载的文件:
readfile('example.zip');
// 禁止缓存当前文档:&n
相关文档:
php中日期转换函数strtotime的用法:
语法:
int strtotime ( string time [, int now] )
返回将任何英文文本的日期时间描述解析为 Unix 时间戳
实例:
一,获取指定日期的unix时间戳 strtotime("2009-1-22") 示例如下:
echo strtotime("2009-1-22") 结果:1232553600
说明:返回2009年1月22日0点 ......
iconv函数库能够完成各种字符集间的转换,是php编程中不可缺少的基础函数库。
1、下载libiconv函数库http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz;
2、解压缩tar -zxvf libiconv-1.9.2.tar.gz;
3、安装libiconv
#configure --prefix=/usr/local/iconv
#make&n ......
<?
$music = $_POST['music'];
//取得所选中的checkbox的个数
$coun=count($music);
if ( is_array( $music ) ) {
echo '您选择的是 : ';
foreach ( $music as $key => $var )
echo ' ['.$var.']';
......
<?
require ("config.php3");
?>
<?
if($submit)
{
//echo $action;
//if($action=='update') &nb ......