Webmastersite.net
Register Log In

Notices undefined indexes in suggest.php
solution included

Comments on Notices undefined indexes in suggest.php

thechronic
Beginner

Usergroup: Member
Joined: Jun 09, 2003
Location: Belgium

Total Topics: 1
Total Comments: 1
Posted Mar 16, 2006 - 2:37 AM:

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 wink
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 16, 2006 - 9:32 AM:

These aren't errors, read the manual to properly configure your php: scripts.webmastersite.net/w...nks/wsnmanual/articles/238
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.