Viewing file: page.php (1.03 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$a = array();
$a[] = round($_POST['top'] / 0.3514598035146,2).'pt';
$a[] = round($_POST['right'] / 0.3514598035146,2).'pt';
$a[] = round($_POST['bottom'] / 0.3514598035146,2).'pt';
$a[] = round($_POST['left'] / 0.3514598035146,2).'pt';
file_put_contents("params.dat", implode(' ',$a));
}
$str = file_get_contents("params.dat");
$str = explode(' ',$str);
for($i = 0; $i < 4; $i++)
$str[$i] = round(((float)$str[$i]) * 0.3514598035146,2);
//
?>
<!doctype html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
</head>
<body>
<h1>³äñòóïè</h1>
<form method="post">
<p>˳âèé: <input type="text" name="left" value="<?=$str[3] ?>"/> ìì</p>
<p>Ïðàâèé: <input type="text" name="right" value="<?=$str[1] ?>"/> ìì</p>
<p>Âåðõí³é: <input type="text" name="top" value="<?=$str[0] ?>"/> ìì</p>
<p>Íèæí³é: <input type="text" name="bottom" value="<?=$str[2] ?>"/> ìì</p>
<p><button>Çáåðåãòè</button></p>
</form>
</body>
</html>
|