My first program

Closed
Report
-
 Anonymous User -
Hello,

this my frist program

it a calculator

so I need your comment to develop my self :)

this is the code source



<html>

<head>

<title> my calculator </title>

</head>

<body bgcolor=black text=white >

<br><br><br><br><br><br><br>

<center>
<?php

/* My First Prgramme ~ calculator ~ */

echo<<<_html_



<form action=$_SERVER[PHP_SELF] method=POST >

<input type=text name=a1 VALUE="input a number"> <p>

<select name=b1 >

<option>+

<option>-

<option>*

<option>/

</select><p>

<input type=text name=c1 Value="input an other number"><p>

<input type=submit value="go!">

</form>

<center><br><br>

<font size=5 color=red > the result = </font>

<font size=5 >

_html_;

$a=$_POST['a1'];

$b=$_POST['b1'];

$c=$_POST['c1'];



if ($b=="+")

{ echo $a + $c ;}

elseif ( $b=="-")

{ echo $a - $c ; }

elseif ( $b=="*")

{ echo $a * $c ; }

elseif ( $b=="/")

{ echo $a / $c ; }

if ( $b =="/" AND $c =="0" )

{ echo " Impossible "; }

?>


</center>

1 reply


yes .... any comment ??