note 111250 deleted from mysql.examples by philip
| From: | philip@php.net | Date: | Wed, 30 Jan 2013 23:58:40 +0000 |
| Subject: | note 111250 deleted from mysql.examples by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193452@lists.php.net to get a copy of this message | ||
Note Submitter: Gerrit
----
<head>
<title> AJAXXXXX </title>
</head>
<body>
<form name="form1" method="post" action="<?php echo
$_SERVER["PHP_SELF"];?>">
<fieldset>
<legend>Rekenmachine</legend>
<p>Getal 1:<input type= "text" size="25" name =
"getal1"></p>
<p>Getal 2:<input type= "text" size="25" name =
"getal2"></p>
<p>Welke operatie? <select name="optie">
<option>+</option>
<option>-</option>
<option>*</option>
<option>/</option>
</select>
</fieldset>
<p>
<input type="submit" value="Reken uit">
</p>
<?php
$getal1 = $_POST["getal1"];
$getal2 = $_POST["getal2"];
$reken = $_POST["optie"];
if($_POST)
{
if($reken == "+")
{
$getal3 = $getal1 + $getal2 ;
echo "Je antwoord is $getal3. ";
}
if($reken == "-")
{
$getal3 = $getal1 - $getal2 ;
echo "Je antwoord is $getal3. ";
}
if($reken == "*")
{
$getal3 = $getal1 * $getal2 ;
echo "Je antwoord is $getal3. ";
}
if($reken == "/")
{
$getal3 = $getal1 / $getal2 ;
echo "Je antwoord is $getal3. ";
}
}
?>
</body>
</html>