Code genereert heel veel foutmeldingen
ik heb volgend probleem aan de hand
in de error log van mijn server (draait php 5.4) krijgt ik tonnen foutmeldingen
ik heb me al suf gezocht naar de oorzaak maar kan niets vinden
kan iemand van jullie me verder helpen?
onze vriend google heeft me ook al laten weten dat ik met een probleem zit
hieronder de foutmeldingen : dit gaat dus 104 mb aan 1 stuk door
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Sat Jan 24 10:14:17 2015] [error] [client 157.55.39.88] File does not exist: /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving1088-promo_Voetdimmer_tci__cd
[Sat Jan 24 10:14:21 2015] [warn] [client 207.46.13.81] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:22 2015] [warn] [client 207.46.13.81] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:31 2015] [warn] [client 207.46.13.56] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:33 2015] [warn] [client 207.46.13.56] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:34 2015] [warn] [client 66.249.78.106] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:34 2015] [warn] [client 207.46.13.56] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:36 2015] [warn] [client 207.46.13.56] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jan 24 10:14:36 2015] [error] [client 207.46.13.56] Premature end of script headers: beschrijving.php
[Sat Jan 24 10:14:37 2015] [warn] [client 207.46.13.81] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 862
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Warning: sort() expects parameter 1 to be array, null given in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 870
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:46 2015] [warn] [client 207.46.13.106] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jan 24 10:14:46 2015] [error] [client 207.46.13.106] Premature end of script headers: beschrijving.php
[Sat Jan 24 10:14:46 2015] [warn] [client 157.55.39.88] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 862
[Sat Jan 24 10:14:46 2015] [warn] [client 157.55.39.88] mod_fcgid: stderr: PHP Warning: sort() expects parameter 1 to be array, null given in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 870
[Sat Jan 24 10:14:46 2015] [warn] [client 157.55.39.88] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:21 2015] [warn] [client 207.46.13.81] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:22 2015] [warn] [client 207.46.13.81] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:31 2015] [warn] [client 207.46.13.56] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:33 2015] [warn] [client 207.46.13.56] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:34 2015] [warn] [client 66.249.78.106] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:34 2015] [warn] [client 207.46.13.56] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:36 2015] [warn] [client 207.46.13.56] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jan 24 10:14:36 2015] [error] [client 207.46.13.56] Premature end of script headers: beschrijving.php
[Sat Jan 24 10:14:37 2015] [warn] [client 207.46.13.81] mod_fcgid: stderr: PHP Strict Standards: Only variables should be passed by reference in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 990
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 862
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Warning: sort() expects parameter 1 to be array, null given in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 870
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:42 2015] [warn] [client 207.46.13.106] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
[Sat Jan 24 10:14:46 2015] [warn] [client 207.46.13.106] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jan 24 10:14:46 2015] [error] [client 207.46.13.106] Premature end of script headers: beschrijving.php
[Sat Jan 24 10:14:46 2015] [warn] [client 157.55.39.88] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 862
[Sat Jan 24 10:14:46 2015] [warn] [client 157.55.39.88] mod_fcgid: stderr: PHP Warning: sort() expects parameter 1 to be array, null given in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 870
[Sat Jan 24 10:14:46 2015] [warn] [client 157.55.39.88] mod_fcgid: stderr: PHP Notice: Undefined variable: productsIntoCategory in /var/www/vhosts/onderdelenvoorhuishoudtoestellen.be/httpdocs/beschrijving.php on line 903
hieronder de code :
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
if($displayProductsList=="oui" AND $displayProductsListNum>0) {
$productsIntoCategory2 = $productsIntoCategory;
if(!isset($_GET['i'])) $_GET['i']=0;
if(isset($_GET['i']) AND $_GET['i']<0) $_GET['i']=0;
$addToQuery2Z = "";
sort($productsIntoCategory2);
$productsNum = count($productsIntoCategory2);
if($productsNum > 0) {
$addToQuery2Z.=" pr.products_id IN(";
$uu = 1;
foreach($productsIntoCategory2 AS $elem) {
$addToQuery2Z.= "'".$elem."',";
$prodId[$uu++] = $elem;
}
$addToQuery2Z.= ") ";
}
else {
$addToQuery2Z= 1;
}
$addToQuery2Z = str_replace(",)",")",$addToQuery2Z);
## Carousel request
$CarQuery = mysql_query("SELECT pr.products_id, pr.products_image, pr.products_name_".$_SESSION['lang'].", pr.products_forsale, pr.products_price, sp.specials_new_price, sp.specials_last_day, sp.specials_first_day, sp.specials_visible,
IF(sp.products_id<>'null'
AND TO_DAYS(sp.specials_first_day) <= TO_DAYS(NOW())
AND TO_DAYS(NOW()) <= TO_DAYS(sp.specials_last_day) , 'oui','non') as toto
FROM products as pr
LEFT JOIN specials as sp
ON (pr.products_id = sp.products_id)
WHERE ".$addToQuery2Z."
AND pr.products_visible='yes'
ORDER BY pr.products_id DESC LIMIT ".$_GET['i'].",".$displayProductsListNum."") or die (mysql_error());
$tototalZ = mysql_num_rows($CarQuery);
if($tototalZ>0) {
$productList="";
$i=100;
$theme = array("C0C0C0", $backGdColorListLine);
$e = 0;
while($carResult = mysql_fetch_array($CarQuery)) {
if(count($productsIntoCategory) > 1) {
## products IDs
$productsIds[] = $carResult['products_id'];
## Display product image
$displayProductInfo = "<div align='center'><img src='im/zzz.gif' width='1' height='15' border='0'></div>";
$displayProductInfo.= "<div align='center'>- ".array_search($carResult['products_id'], $prodId)." ".strtolower(DE)." ".$productsNum." -</div>";
$displayProductInfo.= "<div align='center'><img src='im/zzz.gif' width='1' height='5' border='0'></div>";
$displayProductInfo.= "<div align='center'>";
if($gdOpen == "non") {
$images_widthDesc2 = abs($ImageSizeDesc-70);
$hZ = @getimagesize($carResult['products_image']);
if(!$hZ) $carResult['products_image']="im/zzz_gris.gif";
$image_desc2 = resizeImage($carResult['products_image'],$ImageSizeDesc,$images_widthDesc2);
$displayProductInfo.= "<img src='".$carResult['products_image']."' border='0' width='".$image_desc2[0]."' height='".$image_desc2[1]."' alt='".$carResult['products_name_'.$_SESSION['lang']]."'>";
}
else {
$images_widthDesc2 = abs($ImageSizeDesc-70);
$hZ = @getimagesize($carResult['products_image']);
if(!$hZ) $carResult['products_image']="im/zzz_gris.gif";
$image_desc2 = infoImageFunction($carResult['products_image'],$images_widthDesc2,$ImageSizeDesc);
$displayProductInfo.= "<img src='mini_maker.php?backColor=".$backGdColor."&extension=".$image_desc2[0]."&imageSource=".$carResult['products_image']."&largeurOrigin=".$image_desc2[1]."&hauteurOrigin=".$image_desc2[2]."&largeur=".$image_desc2[3]."&hauteur=".$image_desc2[4]."' alt='".$carResult['products_name_'.$_SESSION['lang']]."' title='".$carResult['products_name_'.$_SESSION['lang']]."' border='0'>";
}
$displayProductInfo.= "</div>";
$displayProductInfo.= "<div align='center'><img src='im/zzz.gif' width='1' height='5' border='0'></div>";
$displayProductInfo.= "<div align='center'><u>".$carResult['products_name_'.$_SESSION['lang']]."</u></div>";
if($carResult['toto']=='oui') {
$priceZ = $carResult['specials_new_price'];
$displayPriceZ = "<div align='center'><img src='im/zzz.gif' width='1' height='10' border='0'></div>";
$displayPriceZ.= "<div style='font-size:11px'><b><s>".$carResult['products_price']." ".$symbolDevise."</s></b></div>";
$displayPriceZ.= "<div class='PromoFontColorNumber' style='font-size:11px'><b>".$priceZ." ".$symbolDevise."</b></div>";
}
else {
$priceZ = $carResult['products_price'];
$displayPriceZ = "<div align='center'><img src='im/zzz.gif' width='1' height='10' border='0'></div>";
$displayPriceZ.= "<div style='font-size:11px'><b>".$priceZ." ".$symbolDevise."</b></div>";
}
if($priceZ=="0.00") $displayPriceZ="";
if((isset($_SESSION['account']) OR $displayPriceInShop=='oui') AND $carResult['products_forsale']=="yes") {
$displayProductInfo.= "<div align='center'>".$displayPriceZ."</div>";
if(isset($_SESSION['reduc']) AND $_SESSION['reduc'] > 0) {
$displayProductInfo.= ($priceZ!=="0.00")? "<div align='center'>".VOTRE_PRIX.": <span class='PromoFontColorNumber' style='font-size:11px'><b>".newPrice($priceZ,$_SESSION['reduc'])." ".$symbolDevise."</b></span></div>" : "";
}
if($devise2Visible=="oui" AND $priceZ>0) $displayProductInfo.= curPrice($priceZ,$symbolDevise2,"center");
}
$displayProductInfo.= "<div align='center'><img src='im/zzz.gif' width='1' height='10' border='0'></div>";
$boxWidth = ($gdOpen == "non")? $boxWidth = $image_desc2[0]+35 : $boxWidth = $image_desc2[3]+35;
$boxposition = $boxWidth/2;
$urlBox = str_replace("id=".$_GET['id'], "id=".$carResult['products_id'] ,$_SERVER["QUERY_STRING"]);
$top = "top:10px; ?top:10px;";
$productList.= "<a href='beschrijving.php?".$urlBox."' class='tooltip2'>";
if(isset($_GET['id']) AND $_GET['id']==$carResult['products_id']) {
$productList.= "<b><span class='fondSelectedProduct'>";
}
else {
$e = $e+1;
if(($e%2) == 0) $ooo=1; else $ooo=0;
$productList.= "<b><span style='background-color:#".$theme[$ooo]."'>";
}
$productList.= "<img src='im/zzz.gif' width='8' height='10' border='0'>";
$productList.= "</b></span>";
$productList.= "<em style='width:".$boxWidth."px; left:-".$boxposition."px; ".$top.";'><div align='left'>".$displayProductInfo."</div></em>";
$productList.= "</a>";
}
}
if(isset($productsIds) AND count($productsIds)>0 AND isset($productsIntoCategory2)) {
sort($productsIds);
$_SESSION['ActiveUrl'] = redirectionZ("i",$_GET['i']);
if(isset($_SERVER["QUERY_STRING"]) AND $_SERVER["QUERY_STRING"]!=="" AND strstr($_SESSION['ActiveUrl'],"?")) $slash2 = "&"; else $slash2 = "?";
$lastProductsIds = $displayProductsListNum;
if(isset($_GET['i']) AND $_GET['i']>0) $lastProductsIds = $lastProductsIds+$_GET['i'];
$previousLastProductsIds = $lastProductsIds-$displayProductsListNum;
$nextCarousel = "<img src='im/zzz.gif' width='5' height='1' border='0'><a href='".$_SESSION['ActiveUrl'].$slash2."i=".$lastProductsIds."'>";
$nextCarousel.= "<img src='im/next.png' alt='".SUIVANTTT."' title='".SUIVANTTT."' border='0'>";
$nextCarousel.= "</a>";
if($lastProductsIds>=$productsNum) $nextCarousel="";
$numProductsInList = end(array_keys($productsIds))+1;
$previousProductsIds = $previousLastProductsIds-$displayProductsListNum;
if($nextCarousel=="") $previousProductsIds = $productsNum-$displayProductsListNum-$numProductsInList;
if($previousProductsIds<0) $previousProductsIds=0;
$prevCarousel = "<a href='".$_SESSION['ActiveUrl'].$slash2."i=".$previousProductsIds."'>";
$prevCarousel.= "<img src='im/prev.png' alt='".PRECEDENT."' title='".PRECEDENT."' border='0'>";
$prevCarousel.= "</a><img src='im/zzz.gif' width='5' height='1' border='0'>";
if($previousLastProductsIds<=0) $prevCarousel="";
}
if(isset($productList) AND $productList!=="") {
if($activeRoundedCornersDesc=='yes') $tableCenter="center"; else $tableCenter="right";
print "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='".$tableCenter."' valign='bottom'>";
print $prevCarousel.$productList.$nextCarousel;
print "</td></tr></table>";
}
}
}
?>
if($displayProductsList=="oui" AND $displayProductsListNum>0) {
$productsIntoCategory2 = $productsIntoCategory;
if(!isset($_GET['i'])) $_GET['i']=0;
if(isset($_GET['i']) AND $_GET['i']<0) $_GET['i']=0;
$addToQuery2Z = "";
sort($productsIntoCategory2);
$productsNum = count($productsIntoCategory2);
if($productsNum > 0) {
$addToQuery2Z.=" pr.products_id IN(";
$uu = 1;
foreach($productsIntoCategory2 AS $elem) {
$addToQuery2Z.= "'".$elem."',";
$prodId[$uu++] = $elem;
}
$addToQuery2Z.= ") ";
}
else {
$addToQuery2Z= 1;
}
$addToQuery2Z = str_replace(",)",")",$addToQuery2Z);
## Carousel request
$CarQuery = mysql_query("SELECT pr.products_id, pr.products_image, pr.products_name_".$_SESSION['lang'].", pr.products_forsale, pr.products_price, sp.specials_new_price, sp.specials_last_day, sp.specials_first_day, sp.specials_visible,
IF(sp.products_id<>'null'
AND TO_DAYS(sp.specials_first_day) <= TO_DAYS(NOW())
AND TO_DAYS(NOW()) <= TO_DAYS(sp.specials_last_day) , 'oui','non') as toto
FROM products as pr
LEFT JOIN specials as sp
ON (pr.products_id = sp.products_id)
WHERE ".$addToQuery2Z."
AND pr.products_visible='yes'
ORDER BY pr.products_id DESC LIMIT ".$_GET['i'].",".$displayProductsListNum."") or die (mysql_error());
$tototalZ = mysql_num_rows($CarQuery);
if($tototalZ>0) {
$productList="";
$i=100;
$theme = array("C0C0C0", $backGdColorListLine);
$e = 0;
while($carResult = mysql_fetch_array($CarQuery)) {
if(count($productsIntoCategory) > 1) {
## products IDs
$productsIds[] = $carResult['products_id'];
## Display product image
$displayProductInfo = "<div align='center'><img src='im/zzz.gif' width='1' height='15' border='0'></div>";
$displayProductInfo.= "<div align='center'>- ".array_search($carResult['products_id'], $prodId)." ".strtolower(DE)." ".$productsNum." -</div>";
$displayProductInfo.= "<div align='center'><img src='im/zzz.gif' width='1' height='5' border='0'></div>";
$displayProductInfo.= "<div align='center'>";
if($gdOpen == "non") {
$images_widthDesc2 = abs($ImageSizeDesc-70);
$hZ = @getimagesize($carResult['products_image']);
if(!$hZ) $carResult['products_image']="im/zzz_gris.gif";
$image_desc2 = resizeImage($carResult['products_image'],$ImageSizeDesc,$images_widthDesc2);
$displayProductInfo.= "<img src='".$carResult['products_image']."' border='0' width='".$image_desc2[0]."' height='".$image_desc2[1]."' alt='".$carResult['products_name_'.$_SESSION['lang']]."'>";
}
else {
$images_widthDesc2 = abs($ImageSizeDesc-70);
$hZ = @getimagesize($carResult['products_image']);
if(!$hZ) $carResult['products_image']="im/zzz_gris.gif";
$image_desc2 = infoImageFunction($carResult['products_image'],$images_widthDesc2,$ImageSizeDesc);
$displayProductInfo.= "<img src='mini_maker.php?backColor=".$backGdColor."&extension=".$image_desc2[0]."&imageSource=".$carResult['products_image']."&largeurOrigin=".$image_desc2[1]."&hauteurOrigin=".$image_desc2[2]."&largeur=".$image_desc2[3]."&hauteur=".$image_desc2[4]."' alt='".$carResult['products_name_'.$_SESSION['lang']]."' title='".$carResult['products_name_'.$_SESSION['lang']]."' border='0'>";
}
$displayProductInfo.= "</div>";
$displayProductInfo.= "<div align='center'><img src='im/zzz.gif' width='1' height='5' border='0'></div>";
$displayProductInfo.= "<div align='center'><u>".$carResult['products_name_'.$_SESSION['lang']]."</u></div>";
if($carResult['toto']=='oui') {
$priceZ = $carResult['specials_new_price'];
$displayPriceZ = "<div align='center'><img src='im/zzz.gif' width='1' height='10' border='0'></div>";
$displayPriceZ.= "<div style='font-size:11px'><b><s>".$carResult['products_price']." ".$symbolDevise."</s></b></div>";
$displayPriceZ.= "<div class='PromoFontColorNumber' style='font-size:11px'><b>".$priceZ." ".$symbolDevise."</b></div>";
}
else {
$priceZ = $carResult['products_price'];
$displayPriceZ = "<div align='center'><img src='im/zzz.gif' width='1' height='10' border='0'></div>";
$displayPriceZ.= "<div style='font-size:11px'><b>".$priceZ." ".$symbolDevise."</b></div>";
}
if($priceZ=="0.00") $displayPriceZ="";
if((isset($_SESSION['account']) OR $displayPriceInShop=='oui') AND $carResult['products_forsale']=="yes") {
$displayProductInfo.= "<div align='center'>".$displayPriceZ."</div>";
if(isset($_SESSION['reduc']) AND $_SESSION['reduc'] > 0) {
$displayProductInfo.= ($priceZ!=="0.00")? "<div align='center'>".VOTRE_PRIX.": <span class='PromoFontColorNumber' style='font-size:11px'><b>".newPrice($priceZ,$_SESSION['reduc'])." ".$symbolDevise."</b></span></div>" : "";
}
if($devise2Visible=="oui" AND $priceZ>0) $displayProductInfo.= curPrice($priceZ,$symbolDevise2,"center");
}
$displayProductInfo.= "<div align='center'><img src='im/zzz.gif' width='1' height='10' border='0'></div>";
$boxWidth = ($gdOpen == "non")? $boxWidth = $image_desc2[0]+35 : $boxWidth = $image_desc2[3]+35;
$boxposition = $boxWidth/2;
$urlBox = str_replace("id=".$_GET['id'], "id=".$carResult['products_id'] ,$_SERVER["QUERY_STRING"]);
$top = "top:10px; ?top:10px;";
$productList.= "<a href='beschrijving.php?".$urlBox."' class='tooltip2'>";
if(isset($_GET['id']) AND $_GET['id']==$carResult['products_id']) {
$productList.= "<b><span class='fondSelectedProduct'>";
}
else {
$e = $e+1;
if(($e%2) == 0) $ooo=1; else $ooo=0;
$productList.= "<b><span style='background-color:#".$theme[$ooo]."'>";
}
$productList.= "<img src='im/zzz.gif' width='8' height='10' border='0'>";
$productList.= "</b></span>";
$productList.= "<em style='width:".$boxWidth."px; left:-".$boxposition."px; ".$top.";'><div align='left'>".$displayProductInfo."</div></em>";
$productList.= "</a>";
}
}
if(isset($productsIds) AND count($productsIds)>0 AND isset($productsIntoCategory2)) {
sort($productsIds);
$_SESSION['ActiveUrl'] = redirectionZ("i",$_GET['i']);
if(isset($_SERVER["QUERY_STRING"]) AND $_SERVER["QUERY_STRING"]!=="" AND strstr($_SESSION['ActiveUrl'],"?")) $slash2 = "&"; else $slash2 = "?";
$lastProductsIds = $displayProductsListNum;
if(isset($_GET['i']) AND $_GET['i']>0) $lastProductsIds = $lastProductsIds+$_GET['i'];
$previousLastProductsIds = $lastProductsIds-$displayProductsListNum;
$nextCarousel = "<img src='im/zzz.gif' width='5' height='1' border='0'><a href='".$_SESSION['ActiveUrl'].$slash2."i=".$lastProductsIds."'>";
$nextCarousel.= "<img src='im/next.png' alt='".SUIVANTTT."' title='".SUIVANTTT."' border='0'>";
$nextCarousel.= "</a>";
if($lastProductsIds>=$productsNum) $nextCarousel="";
$numProductsInList = end(array_keys($productsIds))+1;
$previousProductsIds = $previousLastProductsIds-$displayProductsListNum;
if($nextCarousel=="") $previousProductsIds = $productsNum-$displayProductsListNum-$numProductsInList;
if($previousProductsIds<0) $previousProductsIds=0;
$prevCarousel = "<a href='".$_SESSION['ActiveUrl'].$slash2."i=".$previousProductsIds."'>";
$prevCarousel.= "<img src='im/prev.png' alt='".PRECEDENT."' title='".PRECEDENT."' border='0'>";
$prevCarousel.= "</a><img src='im/zzz.gif' width='5' height='1' border='0'>";
if($previousLastProductsIds<=0) $prevCarousel="";
}
if(isset($productList) AND $productList!=="") {
if($activeRoundedCornersDesc=='yes') $tableCenter="center"; else $tableCenter="right";
print "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='".$tableCenter."' valign='bottom'>";
print $prevCarousel.$productList.$nextCarousel;
print "</td></tr></table>";
}
}
}
?>
Gewijzigd op 24/01/2015 10:44:45 door - Ariën -
Die 'Undefined variable' is makkelijk af te vangen d.m.v. http://php.net/isset
Verder zouden een aantal tab's zeker niet misstaan in deze 'code-brei'.
Gewijzigd op 24/01/2015 10:25:26 door - Ariën -
http://www.onderdelenvoorhuishoudtoestellen.be/php.png
en link 2 : http://www.onderdelenvoorhuishoudtoestellen.be/php2.png
link naar de code : en link 2 : http://www.onderdelenvoorhuishoudtoestellen.be/php2.png
Gewijzigd op 24/01/2015 10:41:09 door Geert Michiels
Gewijzigd op 24/01/2015 10:47:47 door - Ariën -
waarvoor dank
$productsIntoCategory2 = $productsIntoCategory;
Wat is nou het verschil tussen beide variabelen die je gebruikt?
Je kan verder met:
Code (php)
Controleren of deze variabelen bestaan.
Gewijzigd op 24/01/2015 10:52:41 door - Ariën -
Veel foutmeldingen zou je met Google toch echt info over moeten kunnen vinden.
Undefined variable: productsIntoCategory --> variabele bestaat niet/is onbekend.
Warning: sort() expects parameter 1 to be array, null given --> Kennelijk is $productsIntoCategory2 geen array.
Bijv
Ipv
dit omdat hier bij niet alleen $x een waarde krijgt, maar ook het laatste array element current wordt.
(Iets waar ik de afgelopen 10 jaar nog geen toepassing voor had, masr zo werkt die functie)
Gewijzigd op 24/01/2015 15:09:48 door Ivo P
Errorlogs zijn enorm leerzaam, en bij PHP wijzen ze meestal direct naar de plek waar er dingen misgaan dus ik vermoed dat er problemen zijn met de interpretatie ervan?
Mijn eerste vraag zou zijn: heb je deze code zelf geschreven, heb je dit door iemand anders laten doen of heb je deze ergens vandaan geplukt?
Iets wat mij opvalt: er zit nagenoeg geen annotatie in deze code. Als je code niet zelf schrijft kan dit een handig aanknopingspunt zijn, maar ja, hier zul je dus door de code heen moeten ploeteren.
Deze code lijkt ook enigszins gedateerd (gebruik van mysql_query?) en onveilig (script lijkt vatbaar voor SQL-injectie). Daarnaast kan enige refactoring ook geen kwaad:
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?php
$addToQuery2Z.=" pr.products_id IN(";
$uu = 1;
foreach($productsIntoCategory2 AS $elem) {
$addToQuery2Z.= "'".$elem."',";
$prodId[$uu++] = $elem;
}
$addToQuery2Z.= ") ";
?>
$addToQuery2Z.=" pr.products_id IN(";
$uu = 1;
foreach($productsIntoCategory2 AS $elem) {
$addToQuery2Z.= "'".$elem."',";
$prodId[$uu++] = $elem;
}
$addToQuery2Z.= ") ";
?>
-->
Code (php)
1
2
3
4
2
3
4
<?php
$addToQuery2Z = ' pr.products_id IN ('.implode(',', $productsIntoCategory2).')';
$prodId = array_values($productsIntoCategory2); // maar dan vanaf index 0
?>
$addToQuery2Z = ' pr.products_id IN ('.implode(',', $productsIntoCategory2).')';
$prodId = array_values($productsIntoCategory2); // maar dan vanaf index 0
?>
Je zou je ook kunnen afvragen waarom je de informatie in $productsIntoCategory2 (die zelf ook al een kopie is) weer wilt kopieren :/.
Tijd voor een grondige opschoon-ronde?
de ontwerper is jammer genoeg overleden, op hem kan ik dus geen beroep meer doen.
de code is nog geschreven voor een oudere versie van php. kan dit daar iets mee te maken hebben?
Hm, ik vermoed dat het toch iets meer in de hoek zit van "in hoog tempo geschreven" en/of "niet goed getest", PHP-versie heeft er niet eens zoveel mee te maken denk ik.