user login error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: user login error (/showthread.php?tid=18069) Pages:
1
2
|
user login error - El Forum - 04-24-2009 [eluser]Dam1an[/eluser] If you're using native php sessions, you need to call session_start() at the start of your script, not sure if at the start of the controller is sufficient, as I always had it at the very start of the file (normally index.php), but any point before you call it should do user login error - El Forum - 04-24-2009 [eluser]learning_php[/eluser] I added the session_start() but stil get the error Code: A PHP Error was encountered user login error - El Forum - 04-24-2009 [eluser]Dam1an[/eluser] Yeah, the session start was solving the other error (Undefined variable: _SESSION) I'm assuming that row actually exists in the db Try calling it by ID, and see if you can access the username that way user login error - El Forum - 04-26-2009 [eluser]Zeeshan Rasool[/eluser] Did you check that the opening PHP tag for controller model and view is fine. I mean some times we put some fake characters or some blank spaces in our page. please check and clear if any exist. i-e Code: asdsad<?php user login error - El Forum - 04-26-2009 [eluser]TheFuzzy0ne[/eluser] If the $_SESSION variable is not available, there's a good chance that you haven't loaded the session class. I'd suggest you auto load it from within your autoload.php. Also, you should not be access $_SESSION directly, you should be accessing it like this: Code: $this->session->set_userdata('key, 'value'); This has the added advantage that if the specified key is not set, it returns FALSE, so you don't need to mess with isset(). Can you confirm what field names your 'members' table has? I'm wondering if it's not username, but user_name instead. user login error - El Forum - 04-27-2009 [eluser]learning_php[/eluser] Hi, i have look at the database table and it is username, i have also added the session to the autoload but still get the same error: A PHP Error was encountered Severity: Notice Message: Undefined index: ID Filename: models/MAdmins.php Line Number: 17 this is a test row_array1 here is my current code: model: Code: <?PHP controller: Code: <?PHP form: Code: <?= form_open('gallery/verify') ?> user login error - El Forum - 04-27-2009 [eluser]learning_php[/eluser] rewritten form: Code: <?PHP user login error - El Forum - 04-27-2009 [eluser]learning_php[/eluser] Hi, I have just removedid the id from the model and it seems to work but i do have a id in my table that is the PK? Code: <?PHP Also i add this to the routes.php to change the url but it does not work Code: $route['images'] = "gallery/verify"; |