<?php
$cn = mysql_connect("localhost", "user", "");
mysql_select_db("my_DB", $cn);
$testo=trim($_POST['testo']);
$testo = substr("00000000".$_POST["testo"], -8);
$newpage = '../dettagli/formcerca.php';
$wh="";
if(!empty($testo) && preg_match('/^[a-zA-Z0-9]{1,8}/',$testo)){
$wh=" WHERE DATO9='".$testo."'" ;
//doveil nome del campo su cui fare la ricerca lo sai tu
$sel = "SELECT* FROM completo $wh";
//var_dump($sel); LO COMMENTI
$query = mysql_query($sel, $cn );
$quanti = mysql_num_rows($query);
if ($quanti == 0){
echo "<h1>TELAIO ERRATO OPPURE INESISTENTE!</h1>";header('Refresh: 3; url=' . $newpage);
}else{
while($rs=mysql_fetch_array($query)){
echo "<tr> <h1><center>DETTAGLI RICHIESTI :"."<br><br><hr>";
echo "<td> " . $rs[5] . "</td> ";
echo "<td>" . $rs[9] . "</td> ";
echo "<td>" . $rs[29] . "</td> ";
echo "<td>" . $rs[23] . "</td>";
echo "<td>" . $rs[24] . "</td>";
echo "<td>" . $rs[26] ." - ". $rs[27] . "</td>";
echo "<td>" . $rs[50] . "</td>";
echo "<td>" . $rs[52] . "</td>";
echo'<td>
<form method="post" action="salva_telai/modulosalvatelai.php" >
<input type="checkbox" multiple="true"
name="myCheck['.$rs[5].'-'.$rs[9].'___'.$rs[26].' - '.$rs[27].'___'.$rs[24].'___'.$rs[52].']"
value="TELAIO" />
</center></h1><br></tr></td> ';
}
}
}else{
echo "<h1>NON HAI INSERITO NULLA!</h1>";header('Refresh: 3; url=' . $newpage);
}
mysql_close($cn);
?>