You are here:  » Undefined Offset:0 Error in jump.php

Support Forum



Undefined Offset:0 Error in jump.php

Submitted by crounauer on Fri, 2007-08-03 10:36 in

Hello,

Is anyone else getting this error in their log files?

PHP Notice: Undefined offset: 0 in /xxxxxxxxxxx/jump.php on line 5

which relates to this code..

<?php
$product 
$rows[0];
?>

I realise that it mean that the number 0 is not a defined offset.

Regards,
Simon

Submitted by support on Fri, 2007-08-03 10:58

Hello Simon,

This sounds like a web spider is requesting jump.php on its own without an associated product ID. To resolve this, you can easily add a check for an invalid product ID and exit the script gracefully. In jump.php look for the following code on line 6:

  database_querySelect($sql,$rows);

...and change this to:

  if (!database_querySelect($sql,$rows)) exit();

After making the change, double check that your normal product links are still working!

Cheers,
David.

Submitted by crounauer on Fri, 2007-08-03 11:06

Hi David,

Thanks, that makes sense.

It also made me realise that I had omitted to include a restriction on the jump.php page in my robots.txt file.

Thanks again..
Speak soon,
Simon.

Computer Hardware