Simple Form Post Not Working |
I've been stuck here for hours and I can not seem to find the source.
I have a simple login form. Code: <form method="post" class="m-t" role="form" action="<?php echo base_url();?>login/"> The Controller I am Posting to looks like this: PHP Code: class Login extends CI_Controller { The POST DATA is in the array yet I get the following errors. Quote:class Login extends CI_Controller { Quote:A PHP Error was encountered I tried directly accessing the post data via $_POST as shown here: PHP Code: public function login() And then I get the following errors: Quote:A PHP Error was encountered Quote:A PHP Error was encountered It seems anything that uses $this is not working yet it works in my other controllers and I've compared them over and over for basic structure errors. Any help would be greatly appreciated!
Isn't it "public function __construct()" (with two underscores)?
Also, why use "session_start()" (native php function), and then use "$this->session->userdata" (CodeIgniter specific method)? Why not load the session library and then remain using the library all the way around? ...Also, related to the "$this->web_app_model->getLoginData($u, $p);" error. Did you load the model before using it? Website: http://avenir.ro
(04-18-2018, 01:38 AM)Avenirer Wrote: Isn't it "public function __construct()" (with two underscores)? I was following a tutorial from YouTube for getting mu authentication working. Both the single underscore and the session_start() method came from that tutorial and of course in the tutorial they do not encounter the issue I am having. I am loading the web_app_model in in the config/autoload.php file. Any similar occurrences of my issue I've found on google refer to issues with .htaccess and mod_rewrite but I have all of that setup and working as recommended. What seems interesting to me still is that post data is available via $_POST but not vie the Codeigniter method. I am using the latest 3.1.8 build running on XAMPP 5.6.35 Is there some other Global step anyone can identify that could be causing this to fail? |
Welcome Guest, Not a member yet? Register Sign In |