No sale resultado de html a php
Publicado por Alejandro Cabrera (1 intervención) el 09/05/2015 17:38:08
El problema es que en localhost hice la prueba y si sale el resultado por ejemplo sumar dos numeros y si me muestra el resultado, pero lo subi a una pagina para verlo online (HOSTINGER) y ahora no sale el resultado en php sale en blanco la página es http://alejandrocabrera.esy.es/Primer%20parcial/suma.html
Este es el código de suma.html
Este es el código de suma.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<html>
<head>
<meta charset="UTF-8">
<title>Suma</title>
<style type="text/css">
body{
background-color: white;
color: green;
}
fieldset {
width: 500px;
background-color: white;
color: black;
border-style: dotted;
}
legend{
font-size: 10pt;
font-family: Arial;
}
.campo{
text-align: right;
background-color: white;
color: black;
}
.bot{
background-color: black;
color: white;
border-top: none;
border-left: none;
border-right: none;
}
.bot:hover{
font-weight: bolder;
background-color: black;
color: red;
}
</style>
</head>
<body>
<form name="f1" action="suma.php" method="POST">
<center>
<fieldset>
<legend><font size="5">Operaciones Aritméticas</font></legend>
Valor 1:
<input type="text" name="val1" class="campo">
<br/>
Valor 2:
<input type:"text" name="val2" class="campo">
<br/>
<input type="radio" name="op" value="Suma" checked>Suma<br/>
<input type="radio" name="op" value="Resta" checked>Resta<br/>
<input type="radio" name="op" value="Multiplicacion" checked>Multiplicación<br/>
<input type="radio" name="op" value="Division" checked>División<br/>
<input type="submit" name="bot1" value="Resultado" class="bot">
<br/>
</fieldset>
</center>
</form>
<a href= "index.html"> Pagina anterior </a>
</body>
</html>
Este el de Suma.php
<html>
<head>
<font size="6"><tittle>Suma</tittle></font>
</head>
<body>
<table border="1" bgcolor="aqua" width="100%" height="15%" align="center">
<tr><td align="center">
<?php
switch ($op) {
case 'Suma':
$total = $val1+$val2;
echo "La Suma de $val1 + $val2 es $total";
break;
case 'Resta':
$total = $val1-$val2;
echo "La Resta de $val1 - $val2 es $total";
break;
case 'Multiplicacion':
$total = $val1*$val2;
echo "La Multiplicación de $val1 * $val2 es $total";
break;
case 'Division':
$total = $val1/$val2;
echo "La División de $val1 / $val2 es $total";
break; }
?>
</td>
</tr>
</table>
<a href= "index.html"> Pagina anterior </a>
</body>
</html>
Valora esta pregunta


0