<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} </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'])这样写一直无法得到信息
能否告诉我。点击提交的时候,如何判断<input class="txt" type="file" name="content" size="30" />里是否有信息。如何判断提交信息的后缀名。我另开贴·给分
<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']);?>
var_dump($file);
这样能看得出$file是怎么构成的
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'])判断这个就行了 多谢哈
print_r($_FILES);一目了然。