ian2k01 Posted June 5, 2009 Share Posted June 5, 2009 I'm using crontab to run a page every hour. But the crontab-generated mail gives me this message about the ereg_replace(). "PHP Notice: Undefined offset: 6 in /var/www/html/report.php on line 56". Any ideas? 54 $dd = $cookie_file_path; 55 $expHd=explode("%09",urlencode($dd[4])); 56 $expHd[6]=urldecode(ereg_replace("%0A","\\0",$expHd[6])); 57 $val=$expHd[6]; 58 header("Set-Cookie: JSESSIONID=$val; path=/"); 59 echo $val; Link to comment https://forums.phpfreaks.com/topic/161103-php-notice-undefined-offset/ Share on other sites More sharing options...
Maq Posted June 5, 2009 Share Posted June 5, 2009 Are you sure that '$dd[4]' explodes into 7 values? After the explode put: print_r($expHd); Link to comment https://forums.phpfreaks.com/topic/161103-php-notice-undefined-offset/#findComment-850146 Share on other sites More sharing options...
ian2k01 Posted June 5, 2009 Author Share Posted June 5, 2009 Are you sure that '$dd[4]' explodes into 7 values? After the explode put: print_r($expHd); now it gaves me this, not really sure what it means Array ( [0] => %2F ) PHP Notice: Undefined offset: 6 in /var/www/html/eport.php on line 56 PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/report.php:55) in /var/www/html/report.php on line 60 Link to comment https://forums.phpfreaks.com/topic/161103-php-notice-undefined-offset/#findComment-850213 Share on other sites More sharing options...
Maq Posted June 5, 2009 Share Posted June 5, 2009 You're assigning '$val' to '$expHd[6]' and as you can see the index of 6 is undefined (doesn't exist). And I have no clue what your code is supposed to do so I can't really help you. Link to comment https://forums.phpfreaks.com/topic/161103-php-notice-undefined-offset/#findComment-850222 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.