Размер файла: 1.59Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
if ($_GET['act'] == "ok" && !ereg("[A-я_</>\|`'@]", $_POST[1]) && !ereg("[A-я_</>\|`'@]", $_POST[2]))
{
$_POST[1] = htmlspecialchars(stripslashes(trim($_POST[1])));
$_POST[2] = htmlspecialchars(stripslashes(trim($_POST[2])));
if ($_POST[dey] == "umnozh")
{
$t = $_POST[1] * $_POST[2];
}
if ($_POST[dey] == "slozh")
{
$t = $_POST[1] + $_POST[2];
}
if ($_POST[dey] == "delen")
{
$t = $_POST[1] / $_POST[2];
}
if ($_POST[dey] == "vychit")
{
$t = $_POST[1] - $_POST[2];
}
echo 'Ответ: <b>'.$t.'</b><br/><br/>';
}
echo '<form method="post" action="kalc.php?act=ok">
Число:<br /><input name="1" maxlength="50" value="" /><br />
<select name="dey"><option selected="selected">Действия</option>
<option value="umnozh">Умножить</option>
<option value="slozh">Сложить</option>
<option value="vychit">Вычесть</option>
<option value="delen">Делить</option>
</select>
<br/>
Число:<br /><input name="2" maxlength="50" value="" /><br />
<input value="Сосчитать" name="do" type="submit" /></form><br/>';
include_once"../themes/$config_themes/foot.php";
?>