Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: php SESSION - How do I handle SQL data for logged in user??

Started 1 month, 4 weeks ago by Copenhagener
This ought to be so obvious and essential, but I don't understand how I retrieve and update SQL data for a logged-in user with php SESSION. I have searched and read, but the tutorials only explain how I register and start a session for a user, but not the most important part: How do I extract SQL data for this user, and update his data in the SQL database? I have made a registration ...
Site: PHPBuilder.com  PHPBuilder.com - site profile
Forum: Newbies  Newbies - forum profile
Total authors: 2 authors
Total thread posts: 7 posts
Thread activity: no new posts during last week
Domain info for: phpbuilder.com

Other posts in this thread:

Kudose replied 1 month, 4 weeks ago
First, PHP's session's is used to store data across multiple page requests. It doesn't have anything to do with the database. It simply holds values in an array for you. Second, you need to call session_start() before any content is generated to the browser, which means people generally put it near the very top of the script. Third, you need to call session_start() before any calls to the...

Kudose replied 1 month, 4 weeks ago
First, PHP's session's is used to store data across multiple page requests. It doesn't have anything to do with the database. It simply holds values in an array for you. Second, you need to call session_start() before any content is generated to the browser, which means people generally put it near the very top of the script. Third, you need to call session_start() before any calls to the...

Copenhagener replied 1 month, 4 weeks ago
Thank you, Kudose, I will try out your hints when I come back home from work today. What do you mean with " None of this takes data validation into account " ? That I should check the data being passed in through the session too, or? I will be returning with my results later. Thanks again.

Kudose replied 1 month, 4 weeks ago
You should validate the data before you put it into a session. i.e. strip_tags , htmlentities Session data is inaccessible to the end user.

Copenhagener replied 1 month, 4 weeks ago
A very big THANK YOU for spelling it out for me. I can know that you may sometimes be rolling your eyes over us newbies asking questions all the times, but so far I have had very good response from this forum, which is much appreciated. Here is my final script, where I assign the user index as the session variable, making it possible for the user to change his alias later (could I as well ...

Kudose replied 1 month, 3 weeks ago
You are free to change the session data as often as you'd like, but it is temporary storage. To really change the users alias, you would need to write it down somewhere, presumably the database. Glad you are making progress. That's what we're here for.

 

Top contributing authors

Name
Posts
Kudose
4
user's latest post:
[RESOLVED] php SESSION - How do...
Published (2009-11-10 14:25:00)
You are free to change the session data as often as you'd like, but it is temporary storage. To really change the users alias, you would need to write it down somewhere, presumably the database. Glad you are making progress. That's what we're here for.
Copenhagener
3
user's latest post:
[RESOLVED] php SESSION - How do...
Published (2009-11-09 14:50:00)
A very big THANK YOU for spelling it out for me. I can know that you may sometimes be rolling your eyes over us newbies asking questions all the times, but so far I have had very good response from this forum, which is much appreciated. Here is my final script, where I assign the user index as the session variable, making it possible for the user to change his alias later (could I as well just be using the alias as variable without losing it,...

Related threads on "PHPBuilder.com":

Related threads on other sites:

Thread profile page for "php SESSION - How do I handle SQL data for logged in user??" on http://www.phpbuilder.com. This report page is a snippet summary view from a single thread "php SESSION - How do I handle SQL data for logged in user??", located on the Message Board at http://www.phpbuilder.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity