Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Using globals...and stumped?
Old 09-22-2005, 08:03 PM Using globals...and stumped?
Junior Talker

Posts: 3
Trades: 0
ive figured out one problem already but im not sure how to resolve it...im using
PHP Code:
global $_SESSION
but the code

PHP Code:
session_register("username");
                
session_register("userid");

        }

        
$_SESSION['sl'] = true;
        
$sl=true;
        
session_register("sl"); 
is still there and i dont know what to replace it with becuase im pretty sure i need the "username" and "userid" part of the script. I know im not supposed to use globals and the session_register but what variable should i use instead?

im not even sure if ive even figured out the first **** problem...
Hostyle is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-22-2005, 08:10 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
First things first, you don't need to declare the $_SESSION super global array as global. Next try using this instead...

PHP Code:
session_start();

$_SESSION['username'] = 'foo';
$_SESSION['userid'] = 0;
$_SESSION['sl'] = true
Oh, and here is a great reference...

http://www.php.net/manual/en/ref.session.php
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Using globals...and stumped?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38724 seconds with 12 queries