My first program

Closed
Anonymous User - Jun 30, 2009 at 06:15 PM
 Anonymous User - Jul 1, 2009 at 04:17 PM
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>
Related:

1 response

Anonymous User
Jul 1, 2009 at 04:17 PM
yes .... any comment ??
0