Hello :D,
Today i made a php calculator on the website c9 and if you would like to make any edits to it please do
----Code----
(Index.php)
<!DOCTYPE html>
<html>
<head>
<title>Nord From DF</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="container">
<div id="head">
Nord Was Here
</div>
<div id="main">
<form action="capture.php" method="get">
<select name="x">
<?php
for ($x = 0; $x <= 99; $x++) {
echo "<option value=$x>$x</option>";
}
?>
</select>
<select name="y">
<option value="1">/</option>
<option value="2">*</option>
<option value="3">-</option>
<option value="4">+</option>
</select>
<select name="z">
<?php
for ($z = 0; $z <= 99; $z++) {
echo "<option value=$z>$z</option>";
}
?>
</select>
<input type="submit">
</form>
</div>
</div>
</body>
</html>
(Capture.php)
<!DOCTYPE html>
<html>
<head>
<title>PHP Tutorials</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="container">
<div id="head">
PHP Tutorials
</div>
<div id="main">
<?php
$x = $_GET["x"];
$y = $_GET["y"];
$z = $_GET["z"];
switch ($y) {
case 1:
echo $x / $z;
break;
case 2:
echo $x * $z;
break;
case 3:
echo $x - $z;
break;
case 4:
echo $x + $z;
break;
}
?>
</div>
</div>
</body>
</html>
(main.css)
body{
font-family: Verdana, Geneva, sans-serif;
background-color: #5DBB6D;
font-size: 18px;
color: #3A3435;
}
#container{
width: 600px;
margin: auto;
background-color: #F3DBA9;
border:3px solid #DD4730;
}
#head{
background-color: #DD4730;
padding: 15px;
font-size: 200%;
text-align: right;
color: #F3DBA9;
border-bottom:3px solid #DD4730;
}
#main{
min-height:400px;
padding: 15px;
}
Today i made a php calculator on the website c9 and if you would like to make any edits to it please do
----Code----
(Index.php)
<!DOCTYPE html>
<html>
<head>
<title>Nord From DF</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="container">
<div id="head">
Nord Was Here
</div>
<div id="main">
<form action="capture.php" method="get">
<select name="x">
<?php
for ($x = 0; $x <= 99; $x++) {
echo "<option value=$x>$x</option>";
}
?>
</select>
<select name="y">
<option value="1">/</option>
<option value="2">*</option>
<option value="3">-</option>
<option value="4">+</option>
</select>
<select name="z">
<?php
for ($z = 0; $z <= 99; $z++) {
echo "<option value=$z>$z</option>";
}
?>
</select>
<input type="submit">
</form>
</div>
</div>
</body>
</html>
(Capture.php)
<!DOCTYPE html>
<html>
<head>
<title>PHP Tutorials</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="container">
<div id="head">
PHP Tutorials
</div>
<div id="main">
<?php
$x = $_GET["x"];
$y = $_GET["y"];
$z = $_GET["z"];
switch ($y) {
case 1:
echo $x / $z;
break;
case 2:
echo $x * $z;
break;
case 3:
echo $x - $z;
break;
case 4:
echo $x + $z;
break;
}
?>
</div>
</div>
</body>
</html>
(main.css)
body{
font-family: Verdana, Geneva, sans-serif;
background-color: #5DBB6D;
font-size: 18px;
color: #3A3435;
}
#container{
width: 600px;
margin: auto;
background-color: #F3DBA9;
border:3px solid #DD4730;
}
#head{
background-color: #DD4730;
padding: 15px;
font-size: 200%;
text-align: right;
color: #F3DBA9;
border-bottom:3px solid #DD4730;
}
#main{
min-height:400px;
padding: 15px;
}