5, September 2008

getting the $_SESSION['user_id'] ... how? - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: getting the $_SESSION['user_id'] ... how?
« previous next »
Pages: [1] Print

Author Topic: getting the $_SESSION['user_id'] ... how?  (Read 842 times)
OMG!I am geek
**
Posts: 57
394 credits
Members referred : 0


« on: May 14, 2007, 10:35:08 PM »

If I call this every var is printed only $_SESSION['user_id'] not. I don't understand why.
Code:
echo $_SESSION['user']." - ".$_SESSION['user_id']." - ".$_SESSION['logged_in']." - ".$_SESSION['pw'];

For $_SESSION['user_id']
there appears this massage:
Quote
Notice: Undefined index: id ...

How to I get the called user_id?

tom
Metal slug addict
*
Posts: 19
126 credits
Members referred : 0


« Reply #1 on: May 14, 2007, 10:49:18 PM »

Only username and password are stored in session variables I think.
You need something like

$my_user = new Access_user();
$ userid = $my_user->id;

to get the id.

Mike
OMG!I am geek
**
Posts: 57
394 credits
Members referred : 0


« Reply #2 on: May 14, 2007, 11:23:27 PM »


$my_user = new Access_user();
$ userid = $my_user->id;

to get the id.

Mike

verry nice :-)

thanks
tom
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6307
38662 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: May 15, 2007, 10:47:53 AM »

right $_SESSION['user_id'] doesn't exists inside the class script


Last blog : Is your website is down? Know before your visitors do!
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6573
Tags : $_SESSION['user_id']. Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: getting the $_SESSION['user_id'] ... how?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 05, 2008, 07:35:10 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.290
Total Topics: 7.476
Total Members: 3.897
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: FlorianHofmann

26 Guests, 4 Users online :

14 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.