Jump to content

PHP Notice: Undefined offset


ian2k01

Recommended Posts

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

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.