zoukankan      html  css  js  c++  java
  • PHP 之表单提交大数据,数据不完整

    一、代码示例

    前端test.html

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
    <form action="" method="post" class="we7-form" role="form" id="form">
        {$html}
        <input type="submit" value="提交">
        <input type="hidden" name="token" value="{$_W['token']}">
    </form>
    </body>
    </html>

    后端php

    public function doWebTest(){
        global $_W, $_GPC;
    
        if ($_POST) {
            var_dump(count($_POST['check']));
            var_dump(count($_POST['content']));exit();
        }
    
        $html = "";
        for ($i = 0; $i < 3000; $i++) {
            $html .= "<input type=checkbox name=check[] value=$i checked> <input type=hidden name=content[] value='images/4/2021/05/AbtLa7b9jAttablTEbeA4ebB9w7atj.jpg' />";
        }
        include $this->template('test');
    }

    二、解决

     max_input_vars = 100000

  • 相关阅读:
    react: redux-devTools
    react: menuService
    react: navigator
    react style: 二级菜单
    spark复习笔记(5):API分析
    spark复习笔记(4):spark脚本分析
    maven 打包Scala代码到jar包
    spark复习笔记(3)
    mongoDB学习笔记(2)
    sparkStreaming复习笔记(1)
  • 原文地址:https://www.cnblogs.com/yang-2018/p/14971124.html
Copyright © 2011-2022 走看看