including in a session? - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-30-2010, 12:13 PM   #1 (permalink)
Junior Member
 
Join Date: Apr 2010
Posts: 8
Default including in a session?

Hello people

I have created a Userid for my site so that when the user registers they can change their username and other details, and the system will always remember their userid.

At the moment I have made my system to ‘auto-increment’ the userid in the mysql database, so that each new user is assigned a ‘permanent’ userid.

I want to make this userid available to the session so that when the user users some features of my site, their userid is logged along with their comments, for example.

How can I get this userid to be stored inside the session?

Any help would be appreciated.

Many thanks
pedagog is offline   Reply With Quote
Sponsored Links
Old 09-13-2010, 04:37 PM   #2 (permalink)
Regular User
 
Join Date: Sep 2010
Posts: 30
Default Re: including in a session?

$_SESSION['userid'] = $userid;
PradeepKr is offline   Reply With Quote
Old 09-20-2010, 04:24 AM   #3 (permalink)
Junior Member
 
Join Date: Sep 2010
Posts: 3
Default Re: including in a session?

sorry. I'm new here
Andrew58 is offline   Reply With Quote
Old 10-21-2010, 03:43 PM   #4 (permalink)
Junior Member
 
apice internet's Avatar
 
Join Date: Oct 2010
Location: Brazil
Posts: 21
Default Re: including in a session?

Make Table query, store the result in mysql.
Extract the query result by mysql_fetch_array and get the data you want.
Save the session variable you want to equaling it.
apice internet is offline   Reply With Quote
Old 11-16-2010, 10:10 AM   #5 (permalink)
Junior Member
 
Join Date: Feb 2008
Posts: 11
Default Re: including in a session?

When the user log in use the username to get the userid from the table. then start session via session_start(); then store the userid value using session variable for example $_SESSION['userid']=$userid;

in all the places you want to use the userid you need to first declare session_start() to obtain the values stored in session variable
lingsharma is offline   Reply With Quote
Old 12-03-2010, 02:28 AM   #6 (permalink)
Regular User
 
Join Date: Dec 2010
Posts: 249
Default Re: including in a session?

Nice session.........
roja is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:54 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting