Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PHP Server Question - Please answer quickly

    I have localhosting setup, and when i run a script which uses $_SESSION to register the session a text ($_SESSION['s_logged_n'] = 'TRUE'
    i have debugged it by running echo with it and it comes out as null...
    is this a problem with my server? should i change something in the server to allow sessions?

  • #2
    New Coder
    Join Date
    Oct 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is a nobrainer reply, but did you have
    session_start() and
    session_register('s_logged_n');?

    (to check whether session is supported. try echo phpinfo(); )

  • #3
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i dont need to use session_register(); and yes i have used session_start(); hence there are no error messages, it just doesnt show anything, it appears null when i echo it..

  • #4
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    where are you trying to print the var? be aware that you must have session_start() on every page where you need to print session vars.

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's your PHP version? Maybe it doesn't support $_SESSION and you should use $HTTP_SESSION_VARS, so, change your code from:
    PHP Code:
    session_start();
    $_SESSION["something"] = "somethingelse"
    to
    PHP Code:
    session_start();
    session_register("something");
    $HTTP_SESSION_VARS["something"] = "somethingelse"
    It might help as it helped me once

  • #6
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ill try that as a last resort but i have downloaded the latest version of php so i dont think that'd be a problem

  • #7
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Do you have a temp directory set up for your sessions? And is it that path specified in your php.ini file?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #8
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yes. also my mail() function does not work.

  • #9
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Are you positive your temp directory is working? Have you check it after creating a session to see if the session file is actually in there?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #10
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts
    the session files are all there. it just wont let me use them...

  • #11
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ** fixed itself **


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •