471,089 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

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

usafshah
104 100+
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 --->
Expand|Select|Wrap|Line Numbers
  1. $mymusic = new Music($HTTP_GET_VARS['action'], $session['username']); 
Jan 7 '07 #1
4 7482
ronverdonk
4,258 Expert 4TB
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:
Jan 7 '07 #2
usafshah
104 100+


great !! Problem solved .. :D

I changed the $HTTP_GET_VARS to $_GET and $session to $_SESSION and it solved my problem .. many thanks dude ..
Jan 7 '07 #3
ronverdonk
4,258 Expert 4TB
You are welcome any time!

Ronald :cool:
Jan 7 '07 #4
plm66
1
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!
Aug 16 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by PeterF | last post: by
reply views Thread by pillars | last post: by
1 post views Thread by Jim Michaels | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.