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>




  • 相关阅读:
    JBoss下配置数据源加密
    线程返回值的方式介绍
    @Async java 异步方法
    spring 源码下载地址
    springmvc maven 入门及页面拿不到controller的值 显示${message} el表达式不起作用
    mysql常用函数
    eclipse 开发常见问题集锦
    linux 常用命令及零散知识
    js一些注意事项
    liunx 免密登录远程主机
  • 原文地址:https://www.cnblogs.com/caryfang/p/5511517.html
Copyright © 2011-2022 走看看