calculadora
Publicado por Francisco (5 intervenciones) el 29/04/2020 02:11:43
Saludos soy nuevo programando en PHP necesito de sus orientaciones para que me ayuden a que me funcione este pequeño proyecto que me asignaron en crear una calculadora estilo windows ,le adjunto el codigo,gracias de antemano por sus comentarios
me da est error en la linea 8
( ! ) Notice: Use of undefined constant calculo - assumed 'calculo' in C:\wamp\www\proyectos\calculadorabotones3.php on line 8
Call Stack
# Time Memory Function Location
1 0.0035 145232 {main}( ) ..\calculadorabotones3.php:0
( ! ) Notice: Use of undefined constant calculo - assumed 'calculo' in C:\wamp\www\proyectos\calculadorabotones3.php on line 8
Call Stack
# Time Memory Function Location
1 0.0035 145232 {main}( ) ..\calculadorabotones3.php:0
me da est error en la linea 8
( ! ) Notice: Use of undefined constant calculo - assumed 'calculo' in C:\wamp\www\proyectos\calculadorabotones3.php on line 8
Call Stack
# Time Memory Function Location
1 0.0035 145232 {main}( ) ..\calculadorabotones3.php:0
( ! ) Notice: Use of undefined constant calculo - assumed 'calculo' in C:\wamp\www\proyectos\calculadorabotones3.php on line 8
Call Stack
# Time Memory Function Location
1 0.0035 145232 {main}( ) ..\calculadorabotones3.php:0
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
<?php
if($_POST){
$cadena= $_POST['calculo'];
if($_POST['boton'] == "="){
eval('$_POST[calculo] = '.$_POST[calculo].';');
$cadena = $_POST[calculo];
}else{
$cadena= ''.$_POST[calculo].''.$_POST['boton'].'';
}
}
?>
<head>
<title> Calculadora con botones Proyecto de Francisco Leopardi F, CI 5.535.052</title>
</head>
<body>
<form method="post">
<div>
<CENTER>
<input type="text" name="calculo" value="<?echo $cadena?>"/>
<table>
<tr>
<th><input type="submit" name="boton" value="7"/></th>
<th><input type="submit" name="boton" value="8"/></th>
<th><input type="submit" name="boton" value="9"/></th>
<th><input type="submit" name="boton" value="/"/></th>
</tr><tr>
<th><input type="submit" name="boton" value="4"/></th>
<th><input type="submit" name="boton" value="5"/></th>
<th><input type="submit" name="boton" value="6"/></th>
<th><input type="submit" name="boton" value="*"/></th>
</tr><tr>
<th><input type="submit" name="boton" value="1"/></th>
<th><input type="submit" name="boton" value="2"/></th>
<th><input type="submit" name="boton" value="3"/></th>
<th><input type="submit" name="boton" value="-"/></th>
</tr><tr>
<th><input type="submit" name="boton" value="0"/></th>
<th><input type="submit" name="boton" value=","/></th>
<th><input type="submit" name="boton" value="("/></th>
<th><input type="submit" name="boton" value=")"/></th>
</tr>
</table>
<input type="submit" name="boton" value="="/>
</CENTER>
</div>
</form>
</body>
Valora esta pregunta


0