Warning: getdate() expects parameter 1 to be long, string given in /www/life_down/down.php on line 11Warning: getdate() expects parameter 1 to be long, string given in /www/life_down/down.php on line 68
array getdate ( [int timestamp] ),参数是一个时间戳,echo一下或var_dump一下$timestamp看看,看有没有什么问题,是不是太长或太短Warning: Cannot modify header information - headers already sent by (output started at /www/life_down/down.php:11) in /www/life_down/down.php on line 86header()前不能有输出,仔细检查前面的输出
array getdate ( [int timestamp] ),参数是一个时间戳,echo一下或var_dump一下$timestamp看看,看有没有什么问题,是不是太长或太短Warning: Cannot modify header information - headers already sent by (output started at /www/life_down/down.php:11) in /www/life_down/down.php on line 86header()前不能有输出,仔细检查前面的输出
第三个warning问题就是因为getdate函数输出warning导致的.解决参数以后,一切就会正常.
list($viewnum,$downnum,$tviewnum,$tdownnum,$pinfeng,$viewtimes,$viewtimes1)=explode("|",$a_info[2]);
在这后面输入每个值看看,是不是赋值的时间位置搞错了。。
$day_hots=explode("|",$ab_info[2]);
print_r($day_hots);
这后面也看输出看看
$d=getdate($timestamp);
二个变量应该是时间戳,顶楼上,可能就是参数错了!顶下一楼,header前不能有输出,报错是因为有输出!
你明显传入的参数不符合unix时间戳的格式.
//从文件获取数组,以行为索引
$a_info=@file("data/data/$id.php");
//将第二行的数据,传给各个变量.第二行的字符串形如xxx|xxx|xxxx|xxxx
list($txt_category_id,$txt_class_id,$txtshowname,$txtfilename,$txtshow,$txtfilename1,$txtshow1,$txtfilename2,$txtshow2,$txtfilename3,$txtshow3,$fromurl,$size,$order,$hot,$hots,$hide,$usrtool,$runsystem,$txtnote,$times,$imgurl)=explode("|",$a_info[1]);
//将第三行的数据传给各个变量
list($viewnum,$downnum,$tviewnum,$tdownnum,$pinfeng,$viewtimes,$viewtimes1)=explode("|",$a_info[2]);
if($downid==1) $downurl=$txtfilename;
elseif($downid==2) $downurl=$txtfilename1;
elseif($downid==3) $downurl=$txtfilename2;
//这行是第11行,echo $viewtimes;检查是否不合法,如果不合法,打开对应的文件,查找第3行里面的数据
$t=getdate($viewtimes);
//$timestamp也不知道这个变量是在哪初始化的,呵呵.
$d=getdate($timestamp);
$d=getdate($timestamp);
$viewtimes这个变量是时间戳,你在手册里查下什么是时间戳!
比如说
$time=mktime(0,0,0,11,18,2008);
$time就是时间戳!
它有一个长度的!
$viewtimes是第一个时间戳变量!
他是explode("|",$a_info[2])得到的,以’|‘分隔第六个字符,你看写是不是正确的时间戳格式!
如:
$time=mktime(0,0,0,11,18,2008);
$time就是时间戳!
它是数据,有一个长度的!
好好找找问题所在!
你的第二个变量没有提到过,也不知道在哪定义了...
/*
$timestamp=time();
$cookietime = $timestamp+3153600;
if ($REQUEST_URI == $HTTP_COOKIE_VARS['lastpath'] && ($timestamp-$HTTP_COOKIE_VARS['lastvisit_fr']<3)) {
die('本次显示禁止,原因:访问同一URL的刷新时间小于3秒');
}
setCookie('lastpath', $REQUEST_URI, $cookietime);
setCookie('lastvisit_fr', $timestamp, $cookietime);
*//////////////////检查非法字符函数////////////////
function kick_out($info) {
$info = str_replace("\t","",$info);
$info = str_replace("<","<",$info);
$info = str_replace(">",">",$info);
$info = str_replace("\r","<br>",$info);
$info = str_replace("\n","",$info);
$info = str_replace("|","│",$info);
$info = str_replace(" "," ",$info);
return $info;
}function get_classid() {
global $class_name,$classid,$class_time,$ckeckid;
$list=file("data/class.php");
$ckeckid=0;
$count=count($list);
for ($i=0; $i<$count; $i++) {
$detail=explode("|", trim($list[$i]));
if ($detail[0]==$classid) {
$class_name=$detail[1];
$class_time=$detail[2];
$ckeckid=1;
break;
}
}
}
function get_nclassid() {
global $nclass_name,$classid,$nclassid,$nclass_time,$nckeckid;
$list=file("data/nclass.php");
$nckeckid=0;
$count=count($list);
for ($i=0; $i<$count; $i++) {
$detail=explode("|", trim($list[$i]));
if ($detail[1]==$nclassid && $detail[0]==$classid) {
$nclass_name=$detail[2];
$nclass_time=$detail[3];
$nckeckid=1;
break;
}
}
}///////////////读写函数////////////////////function readfrom($file_name) {
$filenum=@fopen($file_name,"r");
@flock($filenum,LOCK_SH);
$file_data=@fread($filenum,filesize($file_name));
@fclose($filenum);
return $file_data;
}
function writeto($file_name,$infoata,$method="w") {
$filenum=@fopen($file_name,$method);
flock($filenum,LOCK_EX);
$file_data=fwrite($filenum,$infoata);
fclose($filenum);
return $file_data;
}//////////////////////////////////////////
@extract($_SERVER, EXTR_SKIP);
@extract($_SESSION, EXTR_SKIP);
@extract($_POST, EXTR_SKIP);
@extract($_FILES, EXTR_SKIP);
@extract($_GET, EXTR_SKIP);
@extract($_ENV, EXTR_SKIP);
///////////////////////////////////////////////////////日期、时间函数//////////////
function get_time($infoatetime){
$t=getdate($infoatetime);
$hour=$t['hours'];
$min=$t['minutes'];
if (strlen($min)==1) $min="0".$min;
return "{$hour}:{$min}";
}
function get_date($infoatetime){
$t=getdate($infoatetime);
$year=$t['year'];
$mon=$t['mon'];
$mday=$t['mday'];
return "{$year}-{$mon}-{$mday}";
}
?>
这个好象是他定义过来的函数程序!!!!!要该这里的什么嘛?