Código:
Este es el archivo de salida:<form name="test" method="post" action="confirm.php"> <div> <div id="clear"><img style="padding-top:30px" src="http://www.forosdelweb.com/images/procesador.gif" name="Procesadores" title="Procesadores" /></div> <fieldset> <legend>Procesadores</legend> <div id="clear"><table ><tr><td id="pro"><input name="2" type="radio" value="Procesador Intel Celeron 420 de 1,6 Ghz" onclick="this.form.precio2.value='990.00';calculate();"><strong><font color="blue">Procesador Intel Celeron 420 de 1,6 Ghz </font></strong></td> <td id="pre"><span>(Lps.990.00)</span></td><br /></tr> </table></div> <div id="clear"><table ><tr><td id="pro"><input name="2" type="radio" value="Procesador Pentium IV 3,0 Ghz" onclick="this.form.precio2.value='1735.00';calculate();"><strong><font color="blue">Procesador Pentium IV 3,0 Ghz </font></strong></td> <td id="pre"><span>(Lps.1735.00)</span></td><br /></tr> </table></div> <div id="clear"><table ><tr><td id="pro"><input name="2" type="radio" value="Procesador Intel Pentium Dual Core E2140 1,66 Ghz" onclick="this.form.precio2.value='1735.00';calculate();"><strong><font color="blue">Procesador Intel Pentium Dual Core E2140 1,66 Ghz </font></strong></td> <td id="pre"><span>(Lps.1735.00)</span></td></td><br /></tr> </table></div> <div id="clear"><table ><tr><td id="pro"><input name="2" type="radio" value="30" onclick="this.form.precio2.value='3180.00';calculate();"><strong><font color="blue">Procesador Intel Pentium Core 2 DUO E4400 2,0 Ghz </font></strong></td> <td id="pre"><span>(Lps.3180.00)</span></td><br /></tr> </table></div> <input type="hidden" name="precio2"> </fieldset><br /> </div> <div> <div id="clear"><img style="padding-top:30px" src="http://www.forosdelweb.com/images/discoduro.png" name="Disco Duro" title="Disco Duro" /></div> <fieldset > <legend>Disco Duro</legend> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco 80 GB" onclick="this.form.precio3.value='1007.00';calculate();"><strong><font color="blue">Disco 80 GB </font></strong></td> <td id="pre"><span>(Lps.1007.00)</span></td><br /></tr></table></div> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco Duro 160 GB - ide" onclick="this.form.precio3.value='12190.00';calculate();"><strong><font color="blue">Disco Duro 160 GB - ide </font></strong></td> <td id="pre"><span>(Lps.1219.00)</span></td><br /></tr></table></div> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco Duro 160 GB - sata 2" onclick="this.form.precio3.value='1338.00';calculate();"><strong><font color="blue">Disco Duro 160 GB - sata 2 </font></strong></td> <td id="pre"><span>(Lps.1338.00)</span></td><br /></tr></table></div> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco Duro 250GB - ide" onclick="this.form.precio3.value='1555.00';calculate();"><strong><font color="blue">Disco Duro 250GB - ide </font></strong></td> <td id="pre"><span>(Lps.1555.00)</span></td><br /></tr></table></div> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco Duro 320GB - sata" onclick="this.form.precio3.value='2144.00';calculate();"><strong><font color="blue">Disco Duro 320GB - sata </font></strong></td> <td id="pre"><span>(Lps.2144.00)</span></td><br /></tr></table></div> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco Duro 250GB SATA " onclick="this.form.precio3.value='1860.00';calculate();"><strong><font color="blue">Disco Duro 250GB SATA </font></strong></td> <td id="pre"><span>(Lps.1860)</span></td><br /></tr></table></div> <div id="clear"><table><tr><td id="pro"><input name="3" type="radio" value="Disco Duro 400GB IDE" onclick="this.form.precio3.value='3492.00';calculate();"><strong><font color="blue">Disco Duro 400GB IDE </font></strong></td> <td id="pre"><span>(Lps.3492)</span></td><br /></tr></table></div> <input type="hidden" name="precio3"> </fieldset><br /> </div> <div> <fieldset style="position:relative;top:36px;width:500px;"> <div id="clear"><p><strong><font size="5">Total:</font></strong> <input type="textfield" name="precio_total"></p></div> <div id="clear"><input type="reset" value="Borrar" onClick="" /><input style="float:right" type="submit" value="continuar" /></div> </fieldset> </div> </form>
Código PHP:
<?
if($_GET['continue'] != 1)
{
$exclude = array('submit','hidden','Precio');
foreach($_POST as $name => $val){
if(in_array($val, $exclude))
continue;
echo "<tr><td><center>".$val."</center></td></tr>\n";
}
?>
<?
}
else
{
header("Location: http://url.com");
}
?>