Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/02/2014, 13:21
miker22
 
Fecha de Ingreso: febrero-2014
Mensajes: 13
Antigüedad: 10 años, 3 meses
Puntos: 0
hay errores en el codigo php

alguien que me pudiera ayudar tengo una pagina php conectada en dreamweaver con su formulario en dreamweaver si me sale bien, pero cuando entro a la carpeta xampp a la carpeta htdocs donde estan almacenados mis documentos y los quiero ver desde alli, el codigo me sale todo mal y el codigo es este
de mi formulario miorderform.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<html>
<body background="fondo.png">
<div id="layer1" style="position:absolute; width:202px; height:144px; z-index:1; left: 46px; top: 206px; text-align: center;">
<form method="post" action="procesarorden.php">
<table width="200" border="0">
<tr bgcolor="#cccccc">
<td width="137">libro</td>
<td width="53">cantidad</td>
</tr>
<tr>
<td>ActionScript</td>
<td align="center"><input name="actionqty" type="text" size="3" maxlength="3" />
</td>
</tr>
<tr>
<td>Photoshop</td>
<td style="text-align: center"><input name="photoqty" type="text" size="3" maxlength="3" /></td>
</tr>
<tr>
<td>Flash MX</td>
<td style="text-align: center"><input name="flashqty" type="text" size="3" maxlength="3" /></td>
</tr>
<tr>
<td>¿como conocio nuestra libreria?</td>
<td><select name="find">
<option value="a">soy un cliente habitual
<option value="b">anuncios de television
<option value="c">informaciones en internet
<option value="d">me lo aconsejo un amigo
</select>
</td>
</tr>


<td colspan="2" align="center"><input type="submit" value="Enviar pedido" /></td>

</tr>
</table>
</form>
</div>
</body>
</html>

y del documento php es procesarorden.php
<html>
<head>
<title>Formulario de pedido de libros</title>
</head>
<body>
<h1>Librer&iacute;a Online </h1>
<h2>Resumen del Pedido </h2>

<?php
echo "<p>Pedido procesado el "; // Start printing order

echo date("jS F,H:i ");
echo "<br>";
echo "<p>Su pedido es el siguiente:";
echo "<br>";
$actionqty=$_POST['actionqty']." ActionScript<br>";
$photoqty=$_POST['photoqty']." Photoshop<br>";
$flashqty=$_POST['flashqty']." Flash MX<br>";


$totalqty = 0;
$totalamount = 0.00;

define("ACTIONPRICE", 100);
define("PHOTOPRICE", 10);
define("FLASHPRICE", 4);

if( $actionqty < 10 )
$descuento = 0;
elseif( $actionqty >= 10 && $actionqty <= 49 )
$descuento = 5;
elseif( $actionqty >= 50 && $actionqty <= 99 )
$descuento = 10;
elseif( $actionqty > 100 )
$descuento = 15;


$totalqty = $actionqty + $photoqty + $flashqty;
$totalamount = $actionqty * ACTIONPRICE
+ $photoqty * PHOTOPRICE
+ $flashqty * FLASHPRICE;

if( $totalqty == 0 )
{
echo "<font color=red>";
echo "No ha introducido ninguna cantidad en el formulario<br>";
echo "</font>";
}
else
{
if($actionqty>0)
echo $actionqty."<br>";
if($photoqty>0)
echo $photoqty."<br>";
if($flashqty>0)
echo $flashqty."<br>";
}
echo "<P>Descuento en libros ActionScript = ".$descuento."%";

switch($find)
{
case "a":
echo "<P>Se trata de un cliente habitual.";
break;
case "b" :
echo "<P>Este cliente nos ha conocido por los anuncios de televisión.";
break;
case "c" :
echo "<P>Este cliente nos ha conocido por informaciones en Internet";
break;
case "d" :
echo "<P>Este cliente nos ha conocido por aviso de un amigo";
break;
default :
echo "<P>No sabemos como nos ha encontrado este cliente.";
break;
}

echo "<br>\n";
echo "Articulos Pedidos: ".$totalqty."<br>\n";
echo "Subtotal: ";
echo number_format($totalamount, 2);
echo "<br>\n";

$taxrate = 0.10; // local sales tax is 10%
$totalamount = $totalamount * (1 + $taxrate);
$totalamount = number_format($totalamount, 2);
echo "Total incluyendo impuestos: ".$totalamount."<br>\n";

?>
</body>
</html>

si alguien me puede ayudar que es lo que estoy haciendo mal