<form action="import.php" method="post" enctype="multipart/form-data">
{if $ok==1}
<table class="box" cellspacing="1" >
111
</table>
{/if}
<span class="post_error">{$post_error.errimpo}&nbsp;</span>
<input class="txt" type="file" name="content" size="30" />
<input type="image" src="{$skin_channel_dir}images/btn_submit.gif" />
</form>
请问我如何在import.php页面获得<input class="txt" type="file" name="content" size="30" />的值
file_get_contents($_FILES['content'])这样写一直无法得到信息

解决方案 »

  1.   

    file_get_contents($_FILES['content']['tmp_name']);//这样试试
      

  2.   

    回amani11兄。这样在我页面什么也输不出。有没有方法,能判断我content的值是否为空?我试了很多方法,不是报错就是什么都不显示。
      

  3.   

    你确定?输出内容,你需要   echo file_get_contents……打印出来
      

  4.   

    可能表述有点问题。这个当它行了。
    能否告诉我。点击提交的时候,如何判断<input class="txt" type="file" name="content" size="30" />里是否有信息。如何判断提交信息的后缀名。我另开贴·给分
      

  5.   

    <HTML>
    <head></head>
    <BODY>
    <form action="kk.php" method="post" enctype="multipart/form-data">
    <input type="file" name="content">
    <input type="submit" name="fun" value="tijiao">
    </form></BODY></HTML>
    kk.php<?php
    $filename=$_FILES['content']['name'];
    //echo $filename;
    $tmp=strrpos($filename,".");
    $type=substr($filename,$tmp+1,strlen($filename)-1);
    echo $type;
    echo $_FILES['content']['size'];
    //echo $_FILES['content']['name'];
    //echo $_FILES['content']['type'];//echo file_get_contents($_FILES['content']);?>
      

  6.   

    $file = $_FILES["file"];
    var_dump($file);
    这样能看得出$file是怎么构成的
      

  7.   

    判断file的size大小大于0就是有呗。
      

  8.   

    回hero0524兄。
    array(5) { ["name"]=> string(0) "" ["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(4) ["size"]=> int(0) } $file = $_FILES["file"];
    var_dump($file);输出结果如上所述我现在var_dump($file['name'])判断这个就行了 多谢哈
      

  9.   

    在 import.php
    print_r($_FILES);一目了然。