forked from sbaghdadi-bit082/testeducon
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPHPDocument2.php
More file actions
93 lines (87 loc) · 1.96 KB
/
PHPDocument2.php
File metadata and controls
93 lines (87 loc) · 1.96 KB
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
<?php
$zahl1=$_POST[zahl1];
$zahl2=$_POST[zahl2];
$zahl3=$_POST[zahl3];
$zahl4=$_POST[zahl4];
$zahl5=$_POST[zahl5];
$zahl6=$_POST[zahl6];
$zahl7=$_POST[zahl7];
$zahl8=$_POST[zahl8];
$zahl9=$_POST[zahl9];
$zahl0=$_POST[zahl0];
if ($_POST[plus])
{
$ergebnis=$zahl1 + $zahl2;
echo "$zahl1 + $zahl2 = $ergebnis";
}
else
{
if ($_POST[minus])
{
$ergebnis=$zahl1 - $zahl2;
echo "$zahl1 - $zahl2 = $ergebnis";
}
else
{
if ($_POST[multiplikation])
{
$ergebnis=$zahl1 * $zahl2;
echo "$zahl1 * $zahl2 = $ergebnis";
}
else
{
if ($_POST[division])
{
if ($zahl==0)
{
$ergebnis="$Error";
echo "$Error";
} else
{
$ergebnis=$zahl1 / $zahl2;
echo "$zahl1 / $zahl2 = $ergebnis";
}
}
else
{
echo
"<table>
<tbody>
<tr>
<td height=\"22\" width=\"100\" bordercolor=\"#0000FF\" bgcolor=\"#C0C0C0\" align=\"right\">\n";
$ergebnis;
echo
"</td>
</tr>\n";
echo
"<tr>
<td>
<form method=\"post\" action=\"rechner.php\">
<center>
<input type=\"submit\" value=\"1\" name=\"zahl1\">
<input type=\"submit\" value=\"2\" name=\"zahl2\">
<input type=\"submit\" value=\"3\" name=\"zahl3\"><br>
<input type=\"submit\" value=\"4\" name=\"zahl4\">
<input type=\"submit\" value=\"5\" name=\"zahl5\">
<input type=\"submit\" value=\"6\" name=\"zahl6\"><br>
<input type=\"submit\" value=\"7\" name=\"zahl7\">
<input type=\"submit\" value=\"8\" name=\"zahl8\">
<input type=\"submit\" value=\"9\" name=\"zahl9\"><br>
<input type=\"submit\" value=\"c\" name=\"reset\">
<input type=\"submit\" value=\"0\" name=\"zahl0\">
<input type=\"submit\" value=\"x\" name=\"multiplikation\"><br>
<input type=\"submit\" value=\"+\" name=\"plus\">
<input type=\"submit\" value=\"--\" name=\"minus\">
<input type=\"submit\" value=\"÷\" name=\"division\"><br>
<input type=\"submit\" value=\"ł√\" name=\"wurzel3\">
<input type=\"submit\" value=\" = \" name=\"losung\" size=\"5\">
<center>
</form>
</td></tr><tr>
<td height=\"15\"><font size=\"1\" face=\"Arial\" color=\"#FF0000\">Wissenschaftlicher Rechner</font></td></tr>
</tbody></table>\n";
}
}
}
}
?>