Derdjengster
Neues Mitglied
Hallo, wie färbe ich die Hintergrundfarbe innerhalb eines Rahmens?
Der Code:
<html>
<head>
<title>Taschenrechner</title>
</head>
<body bgcolor="#e2dde8" </body>
</html>
<div id="center">
<div id="head" class="">
<header cellspacing="10" cellpadding="10" style="width:160px;border:5px solid black;">
<img src="http://www.wilhelmshaven.de/kommunalwahl/Bilder/taschenrechner.PNG">
</div>
<form method="POST" action="taschenrechner.php">
<header cellspacing="10" cellpadding="10" style="width:389px;border:5px solid white;">
<b>Simpler Taschenrechner:</b><br>
<input name="zahl1" size=6 type="number">
<select name="rz">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input name="zahl2" size=6 type="number"><br>
<br>
<input type=submit name=submit value="Rechnen">
</form><?php
if (!empty($_POST["submit"]))
{
$_zahl1 = $_POST["zahl1"];
$_zahl2 = $_POST["zahl2"];
$_rz = $_POST["rz"];
if ($_rz == "+") $c=bcadd($_zahl1, $_zahl2, 2);
if ($_rz == "-") $c=bcsub($_zahl1, $_zahl2, 2);
if ($_rz == "*") $c=bcmul($_zahl1, $_zahl2, 2);
if ($_rz == "/") $c=bcdiv($_zahl1, $_zahl2, 2);
echo $_zahl1 . $_rz . $_zahl2 . "=" . $c;
}?>
Wäre sehr erfreut, wenn mir jemand weiterhelfen könnte.
Danke im Voraus.
Der Code:
<html>
<head>
<title>Taschenrechner</title>
</head>
<body bgcolor="#e2dde8" </body>
</html>
<div id="center">
<div id="head" class="">
<header cellspacing="10" cellpadding="10" style="width:160px;border:5px solid black;">
<img src="http://www.wilhelmshaven.de/kommunalwahl/Bilder/taschenrechner.PNG">
</div>
<form method="POST" action="taschenrechner.php">
<header cellspacing="10" cellpadding="10" style="width:389px;border:5px solid white;">
<b>Simpler Taschenrechner:</b><br>
<input name="zahl1" size=6 type="number">
<select name="rz">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input name="zahl2" size=6 type="number"><br>
<br>
<input type=submit name=submit value="Rechnen">
</form><?php
if (!empty($_POST["submit"]))
{
$_zahl1 = $_POST["zahl1"];
$_zahl2 = $_POST["zahl2"];
$_rz = $_POST["rz"];
if ($_rz == "+") $c=bcadd($_zahl1, $_zahl2, 2);
if ($_rz == "-") $c=bcsub($_zahl1, $_zahl2, 2);
if ($_rz == "*") $c=bcmul($_zahl1, $_zahl2, 2);
if ($_rz == "/") $c=bcdiv($_zahl1, $_zahl2, 2);
echo $_zahl1 . $_rz . $_zahl2 . "=" . $c;
}?>
Wäre sehr erfreut, wenn mir jemand weiterhelfen könnte.
Danke im Voraus.