关于set_time_limit函数的用法,有高人指点吗? 表单接受程序<?phpset_time_limit(0);....其他语句 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to:xuzuning(唠叨)//upload.php<form name="form1" action="upload2.php"><input type="file" name="userfile"><input type="submit" name="submit" value="上传"></form>//upload2.php<? echo $userfile_name;?>提示:超时错误;我把set_time_limit(0);放到upload.php的form中,或者放到upload2.php的echo函数前,都不起作用啊 你改作set_time_limit(300);试试。 <?session_start();?><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>文件上传</title><style>textarea{ overflow-y:visible; border:0px; font-size:12px; font-family: 宋体 Fixedsys; line-height:150%; overflow:visible; border-width:0px; width:780px; height:40px;}</style></head><textarea name='info' cols="" rows="" readonly="readonly"><?$uploaddir = 'upfiles/aa/';if(!file_exists($uploaddir))mkdir($uploaddir);chmod($uploaddir, 0755 );print "\n";$filesname = $_FILES["upfiles"]["name"];$filessize = $_FILES["upfiles"]['size'];$filestype = $_FILES["upfiles"]['type'];$filesTmpName = $_FILES["upfiles"]['tmp_name'];$filestail=strrchr($filesname,".");if(!ereg("zip$",$filestail)){ print "filestail:$filestail \n";}$namestr = str_replace($filestail,"",$filesname);print "namestr:$namestr \n";$strs = split("-",$namestr);print_r($strs);print "filesname:$filesname \n";print "filessize:$filessize \n";print "filestype:$filestype \n";print "filesTmpName:$filesTmpName \n";if(move_uploaded_file($filesTmpName,$uploaddir.$filesname)){ print "File is valid, and was successfully uploaded. Here's some more debugging info:\n"; print_r($_FILES);} else { print "Possible file upload attack! Here's some debugging info:\n"; print_r($_FILES);}}?></textarea> 用以上检查上传是否正确,'error' 值:0; 没有错误发生,文件上传成功。 值:1; 上传的文件超过了 php.ini 中 upload_max_filesize 选项限制的值。 值:2; 上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值。 值:3; 文件只有部分被上传。 值:4; 没有文件被上传。 我试了,还是不行,我看着表,当网页运行了100秒的时候,就提示:Fatal error: Maximum execution time of 30 seconds exceeded in d:\apache\htdocs\2.php on line 8 //upload2.php<?set_time_limit(0); echo $userfile_name;?> to:to:: xuzuning(唠叨)我照你说的方法写的,//upload2.php<? set_time_limit(0); echo $userfile_name;?>问题是:set_time_limit(0)根本就没起作用,写成set_time_limit(600)也只会进行100秒左右的时候就提示错误了,它好象不存在一样?怎么办? httd.cfg这个文件在哪啊?怎么改,麻烦你说清楚一点啦 linux下的打开windows的文件出现 乱码问题 谁能给我个worldpress源码详解? 首页 JS+图片 方式 实现幻灯翻转新闻 ??? 如果获取HTTP 请求协议的原始文本内容?? 有关PHP下载的问题 我在php程序里面写的要在页面显示中文,但在页面确显示不出来,这是怎么会事啊? PHP+MYSQL向数据库存取信息时,出现乱码或出现部分重复混乱现象,如何解决?先谢过!!! 计数器的一个问题? 如何在post后立即取得相应id? 如何在linux下安装php4&mysql?谢谢! 请问file函数的问题。 对一个2维数组安照某个字段排序,发现对字符类型的排序不够理想
//upload.php
<form name="form1" action="upload2.php">
<input type="file" name="userfile">
<input type="submit" name="submit" value="上传">
</form>//upload2.php
<?
echo $userfile_name;
?>
提示:超时错误;
我把set_time_limit(0);放到upload.php的form中,或者放到upload2.php的echo函数前,都不起作用啊
你改作set_time_limit(300);试试。
<?
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文件上传</title>
<style>
textarea
{
overflow-y:visible;
border:0px;
font-size:12px;
font-family: 宋体 Fixedsys;
line-height:150%;
overflow:visible;
border-width:0px;
width:780px;
height:40px;
}
</style>
</head>
<textarea name='info' cols="" rows="" readonly="readonly">
<?
$uploaddir = 'upfiles/aa/';
if(!file_exists($uploaddir))mkdir($uploaddir);
chmod($uploaddir, 0755 );
print "\n";$filesname = $_FILES["upfiles"]["name"];
$filessize = $_FILES["upfiles"]['size'];
$filestype = $_FILES["upfiles"]['type'];
$filesTmpName = $_FILES["upfiles"]['tmp_name'];$filestail=strrchr($filesname,".");
if(!ereg("zip$",$filestail))
{
print "filestail:$filestail \n";
}
$namestr = str_replace($filestail,"",$filesname);
print "namestr:$namestr \n";
$strs = split("-",$namestr);
print_r($strs);print "filesname:$filesname \n";
print "filessize:$filessize \n";
print "filestype:$filestype \n";
print "filesTmpName:$filesTmpName \n";if(move_uploaded_file($filesTmpName,$uploaddir.$filesname))
{
print "File is valid, and was successfully uploaded. Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}}
?>
</textarea>
'error'
值:0; 没有错误发生,文件上传成功。
值:1; 上传的文件超过了 php.ini 中 upload_max_filesize 选项限制的值。
值:2; 上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值。
值:3; 文件只有部分被上传。
值:4; 没有文件被上传。
Fatal error: Maximum execution time of 30 seconds exceeded in d:\apache\htdocs\2.php on line 8
<?
set_time_limit(0);
echo $userfile_name;
?>
我照你说的方法写的,
//upload2.php
<?
set_time_limit(0);
echo $userfile_name;
?>问题是:set_time_limit(0)根本就没起作用,写成set_time_limit(600)也只会进行100秒左右的时候就提示错误了,它好象不存在一样?怎么办?