Jump to content

problem with array error


chanfuterboy

Recommended Posts

hi,

 

can someone explain me maybe help me out with this problem, the error is

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/awortink/public_html/realgame/gallery_viewer.php on line 56

 

and in line 56 is

(!in_array($_SERVER['REMOTE_ADDR'].$url2, $_SESSION['votes'])?

 

Can someone helpme out on this

Link to comment
Share on other sites

quite simply, $_SESSION['votes'] isn't an array.

 

do a print_r on the $_SESSION['votes'] array key and see what you have there. If it's empty but should be an array then you may need a check around the in_array function like:

 

   (is_array($_SESSION['votes']) && !in_array($_SERVER['REMOTE_ADDR'].$url2, $_SESSION['votes'])?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.