PHP - quien me puede ayudar con 2 programas que estoy haciendo

 
Vista:
Imágen de perfil de ricardo

quien me puede ayudar con 2 programas que estoy haciendo

Publicado por ricardo (1 intervención) el 25/06/2015 02:03:58
lo quiero arreglar tengo ver varios errores a ver quuien me ayuda!!!!

archivo php

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
<html>
<head>
 <title>Practica#1</title>
</head>
 
 <body>
<center>
<h1>Calculo del Cuadrado,Cubo y Factorial</h1>
<h2>Practica #1</h2>
<?php
 
$valor1=$_REQUEST['valor1'];
$valor2=$_REQUEST['valor2'];
$valor3=($valor1*$valor1);
$nume=$_REQUEST['num'];
 
echo"El valor de cuadrado es: ",$valor3;
echo"<br><br>";
$valor4=($valor2*$valor2*$valor2);
echo"El valor de cubo es: ",$valor4;
echo"<br><br>";
$promedio=($valor3+$valor4)/2;
 
 
 
 
if ($nume==0){
echo "El Resultado Del Numero es: 1";
}
else if ($nume<-0){
echo "todo numero negativo no debe ser utilizado para el calculo de un factorial";
}
else if ($nume){
$factorial=$nume+1;
echo"El Resultado Es: ",$factorial;}
 
?>
</center>
</body>
</html>



archivo html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<html>
	<head>
	<title>Practica#1</title>
	</head>
 
	<body>
	<center>
<h1>Programa para calcular el valor de Cuadrado, Cubo y Factorial</h1>
<h2>Practica #1</h2>
<form method="post" action="Practica1.php">
 
Ingrese valor numerico
<input type="text" name="valor1";"valor2";"valor3";"num" maxlength="5">
 
<br><br>
 
<br><br>
<input type="submit" value="Cuadrado">   <input type="submit" value="Cubo">   <input type="submit" value="Factorial">
</form>
	</center>
	</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 3.943
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

quien me puede ayudar con 2 programas que estoy haciendo

Publicado por xve (6935 intervenciones) el 25/06/2015 20:54:18
Hola Ricardo, creo que tienes un error en esta linea:
1
<input type="text" name="valor1";"valor2";"valor3";"num" maxlength="5">

Unicamente se envia la variable $_REQUEST['valor1'], el resto esta erroneo.

Si quieres enviar dos valores, tienes que poner dos cuadros de texto:
1
2
3
4
<input type="text" name="valor1" maxlength="5">
<input type="text" name="valor2" maxlength="5">
<input type="text" name="num" maxlength="5">
...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar