Jump to content

Undefined variable & index errors in JoomSEO.php


Das Capitolin

Recommended Posts

JoomSEO is a long-defunct tool to insert SEO terms into articles written on the Joomla CMS. Coinsidently, the JoomSEO.php file is the only code that reports errors for my entire website. Needless to say, I want it fixed so that I can consider my site to be free of obvious code errors.

 

I don't expect this to be a free ride, and I sincerely thank Mchl for previous help, but any and all guidance would be appreciated.  There specific errors are:

Undefined variable: _SESSION in /.../JoomSEO.php on line 7

Undefined index:  count in /.../JoomSEO.php on line 20

Undefined index:  meta.description.text in /.../JoomSEO.php on line 147

Undefined index:  text in /.../JoomSEO.php on line 150

 

The code is attached, but can be pasted if someone confirms that 600 lines of code is okay here.

 

[attachment deleted by admin]

Undefined index applies so an array. Basically if you had this..

 

$arr = array("forename"=>"John", "surname"=>"Smith");
echo $arr['age'];

 

... you are trying to access an item in an array using a key that doesn't currently exist. A solution is to check isset($arr['age']) before doing anything with it. Same applied to undefined variable, only it's a variable name not an item key.

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.