【问题标题】:Codeigniter no POST variables.Codeigniter 没有 POST 变量。
【发布时间】:2013-07-08 16:44:57
【问题描述】:

codeigniter 有问题并尝试对其进行排序数小时,似乎没有发布帖子变量,表单正在工作我使用文件中的 test.php (print_r()) 操作对其进行了测试,并且变量发布正常,所以它的控制器没有按应有的方式进行。

控制器:

print_r($_POST); //Nothing
print_r($this->input->post()); //Nothing
print_r($this->input->post(NULL, TRUE)); //Nothing
exit;

可能是 .htaccess 文件

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php|uploads|img|images|frontcss|css|frontjs|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]


</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

感谢您的帮助

【问题讨论】:

  • 您的控制器名称是什么?确保您的 .htaccess 不包含任何控制器名称
  • 您是在视图中手动编码 html 还是使用 form_open('name', '', $attrib ); 如果手动确保
    标签上有 METHOD="POST"
  • 那是从名称,我尝试使用 form_open 并没有,我的控制器名称是注册.php
  • 如果您的帖子超过最大帖子大小,可能会发生这种情况:stackoverflow.com/questions/2733256/…
  • 您的表单显示代码在哪里?

标签: php html forms codeigniter


【解决方案1】:

您的 mod_rewrite 模块不存在。安装 mod_rewrite。

【讨论】:

    猜你喜欢
    • 2011-07-21
    • 1970-01-01
    • 2011-04-29
    • 1970-01-01
    • 2014-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多