1 and startday<='".$nowyear."-".$nowmonth."-".$nowday."' and expireday>='".$nowyear."-".$nowmonth."-".$nowday."' and customcode='".$q."' "; $result = $db->query($sql); while ($row = $db->fetch_array($result)) { $customcode = $row["customcode"]; $a[] = $customcode; $b[] = $row["fee1"]; $fee = $row["fee1"]*$_SESSION['currency']; } $hint = ""; // lookup all hints from array if $q is different from "" if ($q !== "" ) { $q = strtolower($q); $len=strlen($q); $counter=0; // $_SESSION["coupondiscount"]=""; foreach($a as $name) { if (stristr($q, substr($name, 0, $len))) { if ($hint == "") { //$_SESSION["coupondiscount"]=$b[$counter]; $promoCode=""; // $hint = $feeunit." $".$b[$counter]." ( Discount value will show in payment page)"; $hint = " ".$_SESSION['curr']." ".$fee." "; } else { // $hint .= ", $name"; } } $counter++; } } echo $hint === "" ? "" : $hint; ?>