1.5.5f
i keep getting a persistant error pzen_ajax_compare.php on line 27
PHP Warning: Invalid argument supplied for foreach() in C:\inetpub\Vapeshop.me.uk\pzen_ajax_compare.php on line 27
Code:
13 require('includes/application_top.php');
14 require(DIR_WS_MODULES . 'require_languages.php');
15 // get values
16 $action = $_POST['com_action'];
17 $selected = $_POST['compare_id'];
18 $compare_array = array();
19 $comp_images = '';
20 $compare_warning = '';
21 $comp_value_count = count($_SESSION['compare']);
22 // add new products selected
23 if ($action == 'add') {
24 if ($comp_value_count < COMPARE_VALUE_COUNT) {
25 $compare_array[] = $selected;
26 foreach ($_SESSION['compare'] as $c) {
27 if ($c != $selected) {
28 $compare_array[] = $c;
29 }
30 }
31 $_SESSION['compare'] = array_unique($compare_array);
32 $compare_warning = COMPARE_PRODUCTS_ADDED;
33 } else {
34 $compare_warning = COMPARE_ONETIME_ITEM_COMPARE;
35 }
36 }
can anyone see whats wrong ?????????????????????
Bookmarks