-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson2.php
42 lines (42 loc) · 893 Bytes
/
lesson2.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
41
42
<h3>Вариант 7. Даны диагонали ромба. Найти его площадь.</h3>
<p>
<math>
<mrow>
<mi>S</mi>
<mo>=</mo>
<msub>
<mi>d</mi>
<mn>1</mn>
</msub>
<mo>×</mo>
<msub>
<mi>d</mi>
<mn>2</mn>
</msub>
<mo>÷</mo>
<mn>2</mn>
</mrow>
</math>
</p>
<form action="<?= $_SERVER['REQUEST_URI']?>" method="POST">
<label>d<sub>1</sub> = </label>
<input name='d1' type='number' value='0'/>
<label>cm</label>
<br/>
<label>d<sub>2</sub> = </label>
<input name='d2' type='number' value='0'/>
<label>cm</label>
<br/>
<input type='submit' value='⇓⇓⇓⇓⇓'/>
<br/>
<label>S = </label>
<input name='area' type='number' disabled value="<?
if (isset($_POST['d1']) & isset($_POST['d2']))
{
echo ($_POST['d1']*$_POST['d2']/2);
}
else {echo (0);}?>"/>
<label>cm<sup>2</sup>
</label>
<br/>
</form>