Hey guys, i've been having a go at / learning some php for the last 4 weeks or so. its been really interesting. ive however hit a problem that i cannot find a solution to.

Here is the website in question
http://apnb.du-z.com/

every sixth or so refresh in the 'Hot Items' section one of the items color will turn black rather than blue. it also seems to echo multiple <a></a> tags when it does this also.

Here is the PHP that generates this code:

<?php
// Hot Items Banner
$extract = mysql_query("SELECT idBikeEx, display, titleDescrip, price, salePrice, imgThumb, salePerc FROM products WHERE display='Yes' AND avail='Now In Store' AND newOrUsed='New' ORDER BY views DESC LIMIT 5");
while ($detailSpec = mysql_fetch_assoc($extract))
{
  echo "<a href='?sec=products&page=item&itemId=".$detailSpec[idBikeEx]."'><div id='miniBox'>";
  if (file_exists("images/prodImages/".$detailSpec[idBikeEx]."/t1.jpg"))
  {
       echo "<img src='images/prodImages/".$detailSpec[idBikeEx]."/t1.jpg'alt='".$detailSpec[titleDescrip]."'/>";
  }
  else
  {
       echo "<img src='images/prodImages/noImageThumb.png'alt='".$detailSpec[titleDescrip]."'/>";
  }
  echo "<p style='font-size:12px;color:#151D99'><b>".$detailSpec[titleDescrip]."</b></p>
  <p>$".$detailSpec[price]."<br>";
  if($detailSpec[salePrice]!= 0)
  {
     echo $detailSpec[salePerc]."% OFF";
  }
  echo "</p></div></a>";
}
?>

Im sure its something obvious, but i can't figure it out.

Member Avatar for Zagga

Hi Du-z,

Does the site you linked to contain the code you are having problems with? I have refreshed the page repeatedly and the item text (in the Hot Items section) always shows in blue (with the prices in black) but there are no images shown.
You do have lots of validation errors on the page (including no starting <html> tag) though.


Zagga

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.