Home  >  Article  >  Backend Development  >  apc_fectch()获取不到值解决办法

apc_fectch()获取不到值解决办法

WBOY
WBOYOriginal
2016-06-13 13:35:37944browse

apc_fectch()获取不到值
这是一个进度条的应用,apc的扩展我确定安装成功了.

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$status=apc_fecth('upload_'.$_GET['key']);


我用print_r输出$status,什么都没有显示,

前台返回的值是NAn,可我在后台没有其他乱七八糟的输出啊
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
if(isset($_GET['key']))
{
    echo json_encode(getStatusAPC());
}
function getStatusAPC()
{
    $response=false;
    if($status = apc_fetch('upload_'.$_GET['key'])) {
        $response=apc_fetch('upload_'.$_GET['key']);
    }
    return $response;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
    $myfile=$_FILES['upfile'];
    echo $myfile['size'];
    echo $myfile['size'];
    print_r($myfile);
    $tempf=$myfile['tmp_name'];
    $name=$myfile['name'];
    move_uploaded_file($tempf,'up/'.$name);
}



不知问题出在哪里?求教了

------解决方案--------------------
NAN表示这不是一个有效的数字。print_r($status); 无显示,说明没有值嘛
可以参考这篇文章核对一下你的前台代码 http://bioinfo.ustc.edu.cn/seagven/?p=250
------解决方案--------------------
确保,确实有这个key 'upload_'.$_GET['key']
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn