What was happening with this scrip was it would loop all the vars in a var and post them. However, i did not want it to display the vars if the var was equal too default.gif. So i added some code and basically now it wont show them at all. I think it might just be a variable name problem but i can' tseem to find it. Maby you all could take a look and tell me if you see anything out of the ordinary.
foreach ($pics as $key => $value)
{
if ($value == "default.gif") { unset ($pics[$key]); }
}
that is the code i added to unset the one of the vars if it equals default.gif
$sql = "SELECT * FROM users WHERE user='$name'";
$result = mysql_query($sql,$con);
$row = mysql_fetch_array($result) or die(mysql_error());
$mainpic = $row['mainpic'];
$pic1 = $row['pic1'];
$pic2 = $row['pic2'];
$pic3 = $row['pic3'];
$pic4 = $row['pic4'];
$pics = array($pic1,$pic2,$pic3,$pic4);
foreach ($pics as $key => $value)
{
if ($value == "default.gif") { unset ($pics[$key]); }
}
foreach($pics as $picname)
{
$table .= "
<td align=center><a href=http://c.com/viewimage.php?image=$picname&name=$name> <span style='text-decoration: none'><img
src=http://l.com/pics/$picname height=80 width=80></a></span></td>
";
}
thank you for your time and help
Anthony