Display welcome message |
[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
[eluser]mi6crazyheart[/eluser]
I think these 2 things will help to accomplish u'r task... Codeigniter session: http://ellislab.com/codeigniter/user-gui...sions.html Active Record Class: http://ellislab.com/codeigniter/user-gui...ecord.html
[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.
[eluser]iijb[/eluser]
Hi, Thanks tkyy. Let me check it out. Thanks again iijb |
Welcome Guest, Not a member yet? Register Sign In |