hello, helpfull people
i have got a problem in the source below.
i want to show my price list on the internet by using a txt database.
all fine. but there is an fault in my source. 1st brand is ok 2nd brand is displayed twice, 3rd 3 times so on. only the product are displayed many times the brand name above is ok .
if you know what i do wrong, mail me
thanx (beginner php)
//
<TBODY>
<TR>
<TD height=825 rowSpan=5 vAlign=top width=6><FONT
face=Arial> </FONT></TD></TR>
<TR>
<TD height=746 width=640>
<FORM action="" method=post>
<TABLE border=0 cellPadding=0 cellSpacing=0 height=515 width=542>
<TBODY>
<?
$merken = array('C-Scope','Fisher', 'Viking', 'Tesoro', 'Tesoro');
$foot = count($merken);
for ($p=0; $p< $foot; $p++)
{
$name = $merken[$p];
?>
<TR>
<TD class=bodytext height=69 width=540>
<P><FONT color=#000000 face=Arial
size=5><B><?echo $name;?>: </B></FONT><FONT color=#000000 face=Arial
size=5><B> </B></FONT></P>
<TABLE align=left bgColor=#336699 height=1 width=625>
<TBODY>
<?
$fp = fopen("database.txt", "r+");
while (!feof($fp))
$data[] = fgetcsv ($fp, 4096, ":");
fclose ($fp);
$foo = 0;
$foo = count($data);
$tel = 0;
for ($i=0; $i< $foo; $i++)
{
if(!strcmp($data[$i][2],$name))
{
$select[$tel] = $i;
$tel++;
}
}
$foo2 = 0;
$foo2 = count($select);
for ($count2=0; $count2< $foo2; $count2++)
{
$id_p=$select[$count2];
?>
<tr>
<TD bgColor=#b1c5e7 class=klein height=1 width=213><B><FONT
face=Verdana size=2><?php echo $data[$id_p][1] ?></FONT></B></TD>
<TD align=left borderColor=#0000ff class=klein height=1
width=71 bgcolor="#FF9900">
<P align=left><B>€ <span style="font-family: Times New Roman; font-size: 10pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-GB; mso-fareast-language: NL; mso-bidi-language: AR-SA" lang="EN-GB"><?php echo $data[$id_p][3] ?></span></B></P></TD>
<TD align=left borderColor=#0000ff class=klein height=1 width=66 bgcolor="#FF9900"><B>f <SPAN lang=EN-GB
style="FONT-FAMILY: Times New Roman; FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-GB; mso-fareast-language: NL; mso-bidi-language: AR-SA"> </SPAN><span
style="font-family: Times New Roman; font-size: 10pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-GB; mso-fareast-language: NL; mso-bidi-language: AR-SA" lang="EN-GB"></span><SPAN lang=EN-GB
style="FONT-FAMILY: 'Times New Roman'; FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: NL; mso-bidi-language: AR-SA"><?php echo $data[$id_p][4] ?></SPAN></B>
<TD align=right borderColor=#036690 class=klein height=1
width=13 bgcolor="#FF9900"><FONT face=arial size=2><A
<? If(!$data[$id_p][6] == 0){?>
href="<?php echo $data[$id_p][6] ?>"
target=_self><IMG border=0
src="images/info.gif" width="10" height="16"alt="Voor meer informatie over het produkt!"><? }?> </A></FONT></TD>
<TD align=right bgColor=#FF9900 borderColor=#336699 class=klein
height=1 width=45><a href="bestel.php3?id_x=<? echo $data[$id_p][0] ?>"> <img border="0" src="images/bestel.gif" align="left" width="36" height="14" alt="Bestel hier uw produkt online!"></a>
</TD>
<TD bgColor=#336699 height=1 vAlign=top width=241> </TD>
<TD align=left borderColor=#0000ff class=klein height=1
width=67 bgColor="#336699">
</TD>
<TD align=left borderColor=#0000ff class=klein height=1
width=98 bgColor="#336699">
<TD align=right borderColor=#036690 class=klein height=1
width=15 bgColor="#336699"> </TD>
</tr>
<?}?>
</TBODY></TABLE>
<P> </P>
</TD></TR>
<?
}
?>
<TD class=subkop height=247 width=540>
</TD></TR></TBODY></TABLE></FORM>
<P align=center><FONT face=Arial><IMG height=1
src="prijs_bestanden/stripe.gif" width=500></FONT></P></TD></TR></TBODY></TABLE>
<P align=left><font face="Verdana" size="2">* zonder koffer.</font><FONT face=Arial><br>
Alle prijzen zijn inclusief 19% BTW, wijzigingen
en fouten voorbehouden.</FONT></P></BODY>