|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
PHP Sessions
Feel kinda stupid asking this but i dont wanna use cookies, i wanna use sessions... imanaged to get it set but how the f*ck do i get the data from it? lol
I looked on php.net's website and at all the session stuff but couldnt find anything on how to actually get information that has been set into the session out. Any help would be appreciated, possibly even a snippet of code.
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#2
|
||
|
Problem solved didnt realize you had to register session variables lol... For anyone who wants info on this heres an example and then the webpage
PHP Code:
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#3
|
||
|
$_SESSION is better in my opinion, i guess its up to each one what to use.
|
#4
|
||
|
$_session didnt work for me so i used session register
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#5
|
||
|
Session 1:
Try using $_SESSION['name']="value"; $session=$_SESSION['name']; echo $session; // value Session 2: $session="value"; session_register("session"); <- From the $session var $session=$_SESSION['session']; echo $session; // value Other session junk: You can also use session_is_registered(session); to check if it is a registered session, If(!session_is_registered(session)) { // You need to login? } Else { //You are logged in }
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#6
|
||
|
i used the second example it worked better than the first.
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#7
|
||
|
you cant use $_SESSION[] array and session_register in the same script.
and you should use $_SESSION since session_register() is register_globals dependent. make sure you have those off. most host have them on for some reason. even tho it's off by default in new php versions.
__________________
http://addf.net http://som.addf.net http://snmservers.com http://snmfuturedomination.com ------------------------------------- but there it's a different movie she stares into the screen and fantasies enter her harder than all those who will get to know her |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Enumerating Sessions??? | Sledgehammer | Joint Operations | 11 | 04-20-2008 09:47 AM |
Roadrunner United: All star sessions... | .Simon. | General Chat | 0 | 10-27-2005 12:30 PM |
Well it's PHP but....What do u think | MadMan TCO | Web design and Programming | 18 | 03-09-2005 08:25 PM |
PHP-NUKE and PHP | ~BLÃÐE~ | phphq.Net Forums | 9 | 01-19-2005 06:49 AM |