I changed it. but my problem is that I want Each time user press Do Math, it will be added to the screen
like this php code:
whenever you write the comment , it comes down when you press Add comment. This is my idea.
this is my last code:
<html>
<head><title> test </title> </head>
<body>
<h1> Enter Comment </h1>
<form action="a.php" method="get">
Number1: <input type="text" name="num1">
Number2: <input type="text" name="num2">
<select name="cal">
<option> + </option>
<option> - </option>
<option> / </option>
<option> * </option>
</select>
<input type="submit" value="Do Math">
<?php
$result= "";
if ( $_GET["cal"] == '+' )
$result = $_GET["num1"] ."+". $_GET["num2"] ."=". $_GET["num1"] + $_GET["num2"];
if ( $_GET["cal"] == '-' )
$reslut = $_GET["num1"] - $_GET["num2"] ."=". $_GET["num1"] - $_GET["num2"];
if ( $_GET["cal"] == '/' )
$result = $_GET["num1"] / $_GET["num2"] ."=". $_GET["num1"] / $_GET["num2"];
if ( $_GET["cal"] == '*' )
$result = $_GET["num1"] * $_GET["num2"] ."=". $_GET["num1"] * $_GET["num2"];
setcookie ("result" , "$result" , time()+3600);
?>
</form>
</body>
</html>