zoukankan      html  css  js  c++  java
  • 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>




  • 相关阅读:
    获取控件的xy坐标
    你不知道的JavaScript--Item4 基本类型和基本包装类型(引用类型)
    你不知道的JavaScript--Item3 隐式强制转换
    ajax技术基础详解
    git回退到某个历史版本
    jQuery中 $.ajax()方法详解
    Eclipse Java注释模板设置详解
    MySQL中group_concat函数深入理解
    javascript知识详解之8张思维导图
    javascript 事件编程之事件(流,处理,对象,类型)
  • 原文地址:https://www.cnblogs.com/caryfang/p/5511517.html
Copyright © 2011-2022 走看看