Display welcome message - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Display welcome message (/showthread.php?tid=33479) |
Display welcome message - El Forum - 08-27-2010 [eluser]iijb[/eluser] Hi all, Im a newbie to codeIgniter. I have a login form. And if I successfully login I have to display a welcome message using session variable and also display some basic information from the database on the homepage. How can I achieve it. Please help. Regards iijb Display welcome message - El Forum - 08-27-2010 [eluser]mi6crazyheart[/eluser] I think these 2 things will help to accomplish u'r task... Codeigniter session: http://ellislab.com/codeigniter/user-guide/libraries/sessions.html Active Record Class: http://ellislab.com/codeigniter/user-guide/database/active_record.html Display welcome message - El Forum - 08-27-2010 [eluser]tkyy[/eluser] the first function to set flashdata (to do a session variable, like an alert) the second function to pull some info from the database (from a table called users) and load a new view that should show that data in the variable $database_users (just do a foreach loop and iterate over each item echoing it out) example welcome controller Code: <?php the example view to go with the database query, i put the flash_show() function into a helper for my projects and just call it where i want to show flashdata. Code: <html> to go with this make a database table called users with an id, username and password field and make a 5 or 6 rows manually just to get a feel for how its accomplished. i do my queries by method chaining one line but usually people don't do that, they will throw it on multiple lines etc this is just my preference. Display welcome message - El Forum - 08-27-2010 [eluser]iijb[/eluser] Hi, Thanks tkyy. Let me check it out. Thanks again iijb |