Welcome Guest, Not a member yet? Register   Sign In
Why is $this->input->post() empty?
#1

I'm encountering an issue with CodeIgniter 3.1 where the $this->input->post('XYZ') always returns empty when submitting a form or making an AJAX call. This problem occurs on the server, while it works fine on my local machine.

I have already set csrf_protection to FALSE and confirmed the existence of a .htaccess file with the following content:


<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>
Even if I use the form_open function or directly write the form code, the issue persists. Here's an example of the form code:

<form method="post" id="login_form" action="/index.php/login">
    <label for="email"><?php echo $this->lang->line('username'); ?> *</label>
    <input type="text" name="email" id="email" class="logfeld" autocomplete="username" />
    <label for="passwort"><?php echo $this->lang->line('password'); ?> *</label>
    <input type="password" name="passwort" id="passwort" class="logfeld" autocomplete="current-password" />
    <input class="sendbut" type="submit" name="login" value="<?php echo set_value('passwort'); ?>" />
</form>
How can I resolve this issue and ensure that the form data is properly received?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB