CodeIgniter Forums
Why is $this->input->post('XYZ') returning empty in CodeIgniter? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Why is $this->input->post('XYZ') returning empty in CodeIgniter? (/showthread.php?tid=87823)



Why is $this->input->post('XYZ') returning empty in CodeIgniter? - DharyaRamya - 06-04-2023

I'm encountering an issue with CodeIgniter3.1 Version. The $this->input->post('XYZ') always returns empty when I submit a form or make an AJAX call. Strangely, it works fine on my local machine but not on the server. I have set csrf_protection to FALSE and there is a .htaccess file in place. The following is my form code, and it behaves the same whether I use "form_open" or input the code directly. Why is it only working on my local machine?

html
<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>