Undefined offsets
Posted: Mon May 18, 2009 6:40 pm
I'm new to PHP, but trying to revive an old script. I keep getting the following error message related to cookies and do not understand what is wrong. The first is the error and the second is the acutal script that it refers to.
Notice: Undefined offset: 0 in /home/www/dentonwatch/functions.php on line 17
Notice: Undefined offset: 1 in /home/www/dentonwatch/functions.php on line 17
Notice: Undefined offset: 2 in /home/www/dentonwatch/functions.php on line 17
Notice: Uninitialized string offset: 12 in /home/www/dentonwatch/functions.php on line 15
Code: Select all
09 $cookieInfo = array();
10 $i = 0;
11 $arrayi = 0;
12
13 while ($i < strlen($loginInfo))
14 {
15 while (($loginInfo[$i] !== '-') AND ($i < strlen($loginInfo)))
16 {
17 $cookieInfo[$arrayi] = $cookieInfo[$arrayi].$loginInfo[$i];
18 $i++;
19 } // end while
20 $i++;
21 $arrayi++;
22 } // end while
23
24 return $cookieInfo;