Fatal error: Cannot use object of type Session as array in

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • usafshah
    New Member
    • Nov 2006
    • 104

    Fatal error: Cannot use object of type Session as array in

    Hi all,

    I installed a script and as i run it gives the following error:

    Fatal error: Cannot use object of type Session as array in c:\www\musicbox \index.php on line 2692

    index.php ---> line 2692 --->
    Code:
    $mymusic = new Music($HTTP_GET_VARS['action'], $session['username']);
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Are you sure that you did not misspell the name of the session array? WHen it is your own array, then its name could be $session. However, if this is meant to use an entry in the global $_SESSION array, it must be spelled as $_SESSION['username'].

    Also, do not use the $HTTP_GET_VARS. This is a deprecated array that will not be available any longer in PHP V6. It is better to use $_GET['action'],

    Ronald :cool:

    Comment

    • usafshah
      New Member
      • Nov 2006
      • 104

      #3


      great !! Problem solved .. :D

      I changed the $HTTP_GET_VARS to $_GET and $session to $_SESSION and it solved my problem .. many thanks dude ..

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        You are welcome any time!

        Ronald :cool:

        Comment

        • plm66
          New Member
          • Aug 2007
          • 1

          #5
          Re: Fatal error: Cannot use object of type Session as array in

          Et oui, le blem est résolu juste avec un chercher remplacer
          de $HTTP_GET_VARS pour $_GET et
          $session pour $_SESSION !!

          Valable pour une nulled installation de zainu.
          Merci les pros!

          Comment

          Working...