Foros del Web » Programando para Internet » PHP »

Generar una salida

Estas en el tema de Generar una salida en el foro de PHP en Foros del Web. Hola ya hice esta pregunta y la verdad no se ni es imposible o nadie me entiende? o es muy dificil..La cosa esta asi, yo ...
  #1 (permalink)  
Antiguo 17/01/2008, 22:56
 
Fecha de Ingreso: enero-2008
Mensajes: 11
Antigüedad: 16 años, 3 meses
Puntos: 0
Generar una salida

Hola ya hice esta pregunta y la verdad no se ni es imposible o nadie me entiende? o es muy dificil..La cosa esta asi, yo hize una pagina donde el cliente tiene que seleccionar de una lista de productos lo que ellos desean y asi armar su computadora....ya lo hice, como segundo paso yo quisiera mostrar los productos y el precio de cada producto y la info. del cliente...pero hasta ahora se me ha hecho imposible...lo del confirm.php es lo que tengo, soy nuevo en php y la verdad no se si lo que hice esta bien o mal....

este es el codigo de la primer pagina:

Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Arme Su Computadora!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
#wrap {
width:810px;

}

span {
float:right;
background-color:#CCCCCC;
color:blue;
width:200px;
display:inline;
text-align:center;
font-weight:bold;

}

legend {
	font-weight: bold;
}

img {
float:left;
}

input {
	float:left;
}

fieldset {
	float:right;
	width: 600px;
	padding: 5px;
	margin-right: 4px;
}

#clear {
	clear:both;
}

#pro {
width:300px;
}

</style>
</head>

<SCRIPT language="javascript">
function cent(amount) {
return (amount == Math.floor(amount)) ? amount + '.00' : ( (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}

function calculate() {
var p1, p2, p3 , p4;
var test = document.forms.test;
p1 = test.precio1.value * 1;
p2 = test.precio2.value * 1;
p3 = test.precio3.value * 1;
p4 = test.precio4.value * 1;

precio_total = p1 + p2 + p3 + p4 ;
test.precio_total.value = cent(Math.round(precio_total*Math.pow(10,2))/Math.pow(10,2));
}

</SCRIPT>
<body>
<div id="wrap">
<div>  <img src="http://www.forosdelweb.com/images/baner.png"> </div>

<form name="test" method="post" action="confirm.php">

<fieldset>
<legend>Datos del Cliente:</legend>
<div id="clear">Nombre:<input type="text" name="Nombre:" ></div>
<div id="clear">Correo Electrónico:<input type="text" name="Correo Electronico:" ></div>
<div id="clear">Telefono:<input type="text" name="Telefono:" ></div>
</fieldset>


<div>
<div id="clear"><img style="padding-top:30px" src="http://www.forosdelweb.com/images/windows-vista.png" name="sistemas" title="sistemas" /></div>
<fieldset >
<legend>Sistemas Operativos:</legend>
<div id="clear"><table><tr><td id="pro"><input name="1" type="radio" value="Windows XP Home" onclick="this.form.precio1.value='1733.00';calculate();"><strong><font color="blue">Windows XP Home</font></strong></td> <td id="pre"><span>
			(Lps. 1733.00)</span></td><br /></tr></table></div>
<div id="clear"><table><tr><td id="pro"><input name="1" type="radio" value="Windows XP Profesional" onclick="this.form.precio1.value='2962.00';calculate();"><strong><font color="blue">Windows XP Profesional</font></strong></td><td id="pre"> <span>(Lps. 2962.00)</span></td><br /></tr></table></div>
<tr><td><input type="hidden" name="precio1"></td></tr>
</fieldset><br />

</div>


<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>



</div>    

</body>
</html>
Esta es la pagina donde tengo el problema:

Código PHP:
<table border="1" bordercolor="blue" style="width:400px; margin-left:350px;">
<tr style="color:#0000FF"><td><center><strong>Num</strong></center></td><td><center><strong>Informacion</strong></center></td><td><center><strong>Precio</strong></center></td></tr>

<?

if($_GET['continue'] != 1)
{
     
$name $_GET['class']; 
 
    
// form items you wish to exclude from the info list. you can just make this blank if you dont want to exclude anything
    
$exclude = array('submit','hiddenvalue');
    
    
    foreach(
$_POST as $class => $val){
    
         
        
// if its in the exclude array, skip it
        
if(in_array($val$exclude))
            continue;


        
// print out the info
       
echo "<tr><td><center><strong>".$class."</strong></center></td>"."<td><center>".$val."</center></td></tr>\n";
    }
    
    

    
?>
    
    </table>
    
    </div>
    
   

 <?
}

else
{
    
// do your "its confirmed code"
    // for example, forward the user to a page (uncomment the line):
    // header("Location: http://url.com");
}

?>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:21.