【发布时间】:2013-02-01 21:40:48
【问题描述】:
我试图让 File 元素在 pfbc 中工作,但除了 $_POST['AvatarLrg'] 中的文件名之外,我没有得到任何东西,$_FILES 为空。有人有我可以细读的工作示例吗?
在顶部:
<?php
$form = new Form('trucking_edit');
$form->configure(array( "enctype" => "multipart/form-data" ));
$form->addElement(new Element_File("Profile Avatar:", "AvatarLrg"));
$form->addElement(new Element_Button);
?>
在体内:
<?php $form->render(); ?>
表单显示正常,所有其他元素都能正常显示和工作,只有文件元素:/ 任何帮助表示赞赏。
编辑:生成的 HTML:
<form method="POST" id="edit_profile" action="profile.php?pid=16&edit=save" name="tf_profileedit">
...
<div class="control-group">
<label class="control-label" for="trucking_edit-element-3">Profile Avatar:</label>
<div class="controls">
<input type="file" name="AvatarLrg" id="trucking_edit-element-3"/>
</div>
</div>
...
</form>
【问题讨论】:
-
可以添加表单生成的HTML吗?
标签: php forms file-upload