我在我的网站上使用 smarty 和 PHP。以下是我来自 smarty 模板的表单代码。
<form id="manage_reply_enquiry" name="manage_reply_enquiry" method="post" action="{$control_url}modules/enquiries/reply_to_enquiry.php" enctype="multipart/form-data">
<ul>
<li>
<label>{'To Name'|signal_on_error:$error_msg:'contact_name'} :</label>
<div class="form-element">
<input type="text" name="contact_full_name" id="contact_full_name" value="{$data.contact_full_name|capitalize}" class="">
</div>
</li>
<li>
<label>{'To Email'|signal_on_error:$error_msg:'email'} :</label>
<div class="form-element">
<input type="text" name="contact_email_id" id="contact_email_id" value="{$data.contact_email_id}" class="">
</div>
</li>
<li>
<label>{'Reply'|signal_on_error:$error_msg:'reply'} :</label>
<div class="form-element">
<textarea name="reply" id="reply" cols="60" rows="12">{$data.reply}</textarea>
</div>
</li>
<li>
<label>{'Upload File'|signal_on_error:$error_msg:'reply_file_name'} :</label>
<div class="form-element">
<p class=""><input type="file" id="reply_file_name" name="reply_file_name" /></p>
<div class="input-info"> <span class="required">Note* (Image size should be less then 1 mb and alowed format types are CSV, XLS)</span></div>
</div>
</li>
<input type="hidden" name="contact_id" value="{$data.contact_id}" />
<input type="hidden" name="from_date" value="{$from_date}" />
<input type="hidden" name="to_date" value="{$to_date}" />
<input type="hidden" name="op" value="{$op}" />
<li>
<label></label>
<div class="form-element">
<input type="submit" name="submit" id="submit" class="c-btn" value="Send">
<input type="button" name="cancel" id="cancel" class="c-btn" value="Cancel" onclick="javascript:window.location.href='{$control_url}modules/enquiries/view_contact_us.php?page={$page}&from_date={$from_date}&to_date={$to_date}'">
</div>
</li>
</ul>
</form>
如果我在reply_to_enquiry.php文件中打印发布的数据,我会得到以下数据:
Array
(
[contact_full_name] => ABCD
[contact_email_id] => abcd@gmail.com
[reply] => How are you now?
[contact_id] => 59
[from_date] => 10/09/2000
[to_date] => 10/09/2013
[op] => view
[submit] => Send
)
你能告诉我为什么我不能从表单中名为reply_file_name的文件控件中获取值吗?我不明白为什么会这样。任何人都可以在这方面帮助我吗?提前致谢。