function ricerca(){
var ric;
if (document.base.ricerca.value==""){
window.alert("Inserire un codice da ricercare");
}else{
ric=document.base.ricerca.value;
window.location.href="ricerca.php?id="+ric;
}
}

<body>
<form name=base>

<center>
Elenco Prodotti
</center>




<table width=100% border=1>
<tr>
<td width=10% align=center>
Codice
</td>
<td width=25% align=center>
Categoria
</td>
<td width=20% align=center>
Articolo
</td>
<td width=10% align=center>
Descrizione
</td><td width=10% align=center>
Prezzo
</td>
<td width=15% align=center colspan=2>
Opzioni
</td>

</tr>

while($record = mysql_fetch_array($result)) {
print '
<tr>
<td align=center>';
print $record[id]."
";
print '
</td>
<td>';
print $record[categoria]."
";
print '
</td>

<td>';
print $record[articolo]."
";
print '
</td>
<td>';

print 'Dettagli...';

print '
</td>
<td>';
print $record[prezzo]."
";
print '
</td>


<td align=center>
';
print '<input type=button name=bottone value=Cancella onclick=javascript:document.location.href="cancell a.php?id='.$record[id].'">';
print '
</td>


<td align=center>
';
print '<input type=button name=bottone value=Modifica onclick=javascript:document.location.href="modific a.php?id='.$record[id].'">';
print '
</td>
</tr>
';

}
print '
</td>
</tr>
<tr>
<td colspan=7>
Ricerca per codice:

<input type=text name=ricerca>


<input type=button name=bottone value=Ok onclick="ricerca();">
</td>
</tr>

';

?>
</table>
</form>
</body>
</html>