Login   Register  
PHP Classes
elePHPant
Icontem

Undefined offset: 1 on line 79

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Secure Session Extended  >  All threads  >  Undefined offset: 1 on line 79  >  (Un) Subscribe thread alerts  
Subject:Undefined offset: 1 on line 79
Summary:Notice in the class
Messages:2
Author:Marco Rossi
Date:2012-10-08 17:43:02
Update:2012-10-11 16:35:32
 

  1. Undefined offset: 1 on line 79   Reply   Report abuse  
Picture of Marco Rossi
Marco Rossi
2012-10-08 17:43:02
Hi!
I've tried this script, but sometimes i get this error:

Undefined offset: 1 on line 79

the line is:
$Blocks[] = $IPComponents[$iBlocks];


Where is the problem?

Thank you very much!

Byez!

  2. Re: Undefined offset: 1 on line 79   Reply   Report abuse  
Picture of Seth Carter
Seth Carter
2012-10-11 16:35:32 - In reply to message 1 from Marco Rossi
Hi,

If you're getting this error then it means that the $IPComponents variable probably isn't an array (failed to explode the IP), check the value of $_SERVER['REMOTE_ADDR'] if you get this error - It SHOULD be an IP address but depending on your ISP you may need to substitude this setting with another value, like HTTP_X_FORWARDED_FOR or something else depending on your setup.

Check out this thread on stack overflow for some tips on whats best to use for your situation:

http://stackoverflow.com/questions/527638/getting-the-client ...

Seth