Foros del Web » Programando para Internet » PHP »

Ayuda!!!

Estas en el tema de Ayuda!!! en el foro de PHP en Foros del Web. Hola tengo una tienda virtual donde el usuario puede configurar una computadora seleccionando varios botones de opcion, y tambien creé un php que es la ...
  #1 (permalink)  
Antiguo 16/01/2008, 14:13
 
Fecha de Ingreso: enero-2008
Mensajes: 11
Antigüedad: 16 años, 3 meses
Puntos: 0
Ayuda!!!

Hola tengo una tienda virtual donde el usuario puede configurar una computadora seleccionando varios botones de opcion, y tambien creé un php que es la pagina de confirmacion, que me muestra el nombre del producto seleccionado, el precio entre otras cosas, mi problema es como puedo hacer que la tabla que me produce en el php se vea mas ordenada de lo que yo tengo?

estos son mis dos archivos ayuda por favor......
Aqui esta la 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, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17;
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;
p5 = test.precio5.value * 1;
p6 = test.precio6.value * 1;
p7 = test.precio7.value * 1;
p8 = test.precio8.value * 1;
p9 = test.precio9.value * 1;
p10 = test.precio10.value * 1;
p11 = test.precio11.value * 1;
p12 = test.precio12.value * 1;
p13 = test.precio13.value * 1;
p14 = test.precio14.value * 1;
p15 = test.precio15.value * 1;
p16 = test.precio16.value * 1;
p17 = test.precio17.value * 1;
precio_total = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 + p11 + p12 + p13 + p14 + p15 + p16 + p17;
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="confirm2.php">

<fieldset>
<legend>Datos del Cliente:</legend>
<div id="clear">Nombre:<input type="text" name="Nombre:" ></div>
<div id="clear">Email:<input type="text" name="Email" ></div>
<div id="clear">Telefono:<input type="text" name="Telefono:" ></div>
</fieldset>

<div id="clear"><fieldset><legend>Instrucciones:</legend>Seleccione (dando click en el circulo) el componente de su conveniencia para armar su computadora:</fieldset></div>
<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>
aui esta mi problema:

Código PHP:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
<style type="text/css">
body {
margin-left:auto;
margin-right:auto;
    }
}

.direccion {
margin-left:inherit;
    text-align: center;
}

td {
border:medium,black;
}

.direccion {
    font-family: Arial;
}
</style>
</head>
<body>
<div style="float:right;width:600px"><a href="#" onClick="javascript:window.print(); return true">Imprimir</a></div> <br /> <br />
<div style="width:auto;text-align:center;border-color:black;text-indent:5px;">

<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");
}

?>

</body>

Última edición por Pastrulo; 16/01/2008 a las 14:39
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 06:52.