Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-25-2004, 07:08 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
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/

Reply With Quote
  #2  
Old 04-25-2004, 08:43 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
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:
            session_register("username");
            
session_register("password"); 
username and password are elements taken from a form that has been submitted.... More informatoin on this here... http://us4.php.net/manual/en/functio...n-register.php
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net.
Free Teamspeak servers: http://gamersnetwork.us/

Reply With Quote
  #3  
Old 04-26-2004, 08:23 AM
SilentTrigger is offline SilentTrigger
-1PARA-

Join Date: Sep 2002
Location: Sweden
Posts: 3,972

$_SESSION is better in my opinion, i guess its up to each one what to use.
__________________
-1PARA-AlexKall

My photography website



Reply With Quote
  #4  
Old 04-26-2004, 02:54 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
$_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/

Reply With Quote
  #5  
Old 04-26-2004, 03:32 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,922

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
Reply With Quote
  #6  
Old 04-26-2004, 05:09 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
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/

Reply With Quote
  #7  
Old 04-26-2004, 09:18 PM
prey is offline prey
Registered User

Join Date: Mar 2004
Posts: 119

Send a message via ICQ to prey
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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Forum Jump

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


All times are GMT -5. The time now is 03:16 AM.




Powered by vBulletin®