<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
if (!empty($_GET["num1"])) {
$a=intval($_GET["num1"]);
$c=$a*15.35;
echo "{$a}元={$c}円";
} else {
echo <<< EOM
<h1>rate calculator</h1>
<form>
RMB:
<input type="text" name="num1" size="5">
<input type="submit" value="OK">
</form>
EOM;
}
?>
<input type="button" onclick="history.back()" value="back">
</body>
</html>