Notices undefined indexes in suggest.php solution included
This thread is closed, so you cannot post a reply.
Comments on Notices undefined indexes in suggest.php
Beginner
Usergroup: Member
Joined: Jun 09, 2003
Location: Belgium
Total Topics: 1
Total Comments: 1
The suggest.php page generates notices about undefined array indexes in the PHP error log.
PHP Notice: Undefined index: catid in suggest.php on line 2
PHP Notice: Undefined index: backupcatid in suggest.php on line 2
This can be solved by replacing the following code:
if (!$_POST['catid']) { $_POST['catid'] = $_POST['backupcatid']; $_REQUEST['catid'] = $_REQUEST['backupcatid']; } // evade illogical error of missing catid
with this code:
// evade illogical error of missing catid
if ( !isset( $_POST['catid'] ) ) {
if ( isset( $_POST['backupcatid'] ) ) $_POST['catid'] = $_POST['backupcatid'];
if ( isset( $_REQUEST['backupcatid'] ) ) $_REQUEST['catid'] = $_REQUEST['backupcatid'];
}
In general the code in this page looks rather messy
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
These aren't errors, read the manual to properly configure your php: scripts.webmastersite.net/w...nks/wsnmanual/articles/238