magento后台使用POST表单时,要使用必要参数form_key才能正常通讯

 
 
<form action="<?php echo $this->getSaveUrl() ?>" method="POST" enctype="multipart/form-data">
<label for="up_file">批量处理表格:</label>
<input type="file" name="up_file" id="up_file" value="选择文件" />
<!--没有这个form_key会被重定向到首页-->
<input type="hidden" name="form_key" value="<?=Mage::getSingleton('core/session')->getFormKey() ?>">
<br/>
<br/>
<input type="submit" value="导入">
<br/>
<br/>

<hr/>
<br/>
<br/>

<span>本地共导入条<?=$this->getTotalNum()?>数据,成功<?=$this->getSuccNum()?>条,失败<?=$this->getErrorNum()?>条。</span>
<br/>
<br/>

<table class="uptemplate_result_table">
<tr>
<th></th>
<th>SKU</th>
<th>错误提示</th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</form>



<form action="http://www.5s.cn/index.php/5staradmin2013/catalog_product/upTemplate/key/fbdb8679355c0dfa12387b303374af130c9bb20241454b129659f2134eb91292/" method="POST" enctype="multipart/form-data">
    <label for="up_file">批量处理表格:</label>
    <input type="file" name="up_file" id="up_file" value="选择文件">
    <input type="hidden" name="form_key" value="eswJsUit3B1OCmdp">
    <br>
    <br>
    <input type="submit" value="导入">
    <br>
    <br>

    <hr>
    <br>
    <br>

    <span>本地共导入条10数据,成功10条,失败10条。</span>
    <br>
    <br>

    <table class="uptemplate_result_table">
        <tbody><tr>
            <th>行</th>
            <th>SKU</th>
            <th>错误提示</th>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </tbody></table>
</form>




转载于:https://www.cnblogs.com/caryfang/p/5511517.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值