Current location: Hot Scripts Forums » Programming Languages » PHP » sessions and register_global is off


sessions and register_global is off

Reply
  #1 (permalink)  
Old 07-13-09, 02:39 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
sessions and register_global is off

lately i've been tolled that register_global better be off. so i did. but now am having a meager problem. sessions variables value is not stored. when i register a new session it works but the value of the variable in the session is not stored and do not pass from page to another although i use $_GET and $_POST and it do works ok.

am using session_start() and session_register() i tried $_SESSION but its not working as will ?

any ideas !!

* NOTE : am using global to at the start of each page am using a session variable.

thanks in advance,
Reply With Quote
  #2 (permalink)  
Old 07-13-09, 03:17 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Eh, can you post your actual code? That would make debugging a lot easier. Not sure what "global" you're talking about.

Also, session_register() is deprecated. Sessions are as simple as:
(page 1)
PHP Code:

session_start();
$_SESSION['foo'] = 'hello world'
(page 2)
PHP Code:

session_start();
echo 
$_SESSION['foo']; 
Reply With Quote
  #3 (permalink)  
Old 07-13-09, 07:18 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
thanks Nico,

you were right about it. i placed session_functions with the $_SESSION[''] and it worked fine. thankx a lote.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:42 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.