Jump to content


Photo

A very simple question.....i think


  • Please log in to reply
4 replies to this topic

#1 umbrella_thing

umbrella_thing
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 20 July 2006 - 05:39 AM

Simply.

How do I get the session id ?
I want to use it as a primary key in a table.. but .. I dont how to "get" it..
Its gotta be something totally simple right?

Thanks dudes!

#2 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 20 July 2006 - 05:44 AM

$arr = explode('=', SID);

echo "session id is " . $arr[1];

//$arr[1] hold the session id
Life's too short for arguing.

#3 umbrella_thing

umbrella_thing
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 20 July 2006 - 05:53 AM

hmm this doesn't seem to work for me..

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 20 July 2006 - 06:39 AM

echo session_id();


Does that work?

#5 umbrella_thing

umbrella_thing
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 20 July 2006 - 06:50 AM

yeah it does, at the same time I just found it on php.net
ahh thanks for that matey
:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users