PDA

View Full Version : کمک ماشین حساب



jeferson
جمعه 30 فروردین 1392, 21:42 عصر
سلام دوستان
من تازه کارم کد ماشین حسابه کجاش مشکل داره
لطفا راهنمای کنید
جواب چاب نمیکنه


<html>
02 <head>
03 <title>Calculator</title>
04 </head>
05
06
07 <body>
08 <? php
09
10 if ($option == add)
11 {
12 $one = $first;
13 $two = $second;
14 $result = $one + $two;
15 echo $result;
16 }
17
18 if ($option == sub)
19 {
20 $one = $first;
21 $two = $second;
22 $result = $one - $two;
23 echo $result;
24 }
25
26 if ($option == mul)
27 {
28 $one = $first;
29 $two = $second;
30 $result = $one * $two;
31 echo $result;
32 }
33
34 if ($option == div)
35 {
36 $one = $first;
37 $two = $second;
38 $result = $one / $two;
39 echo $result;
40 }
41
42
43 ?>
44 <form name="calcform">
45 <table border="4" bordercolor="blue" bgcolor="lightblue">
46
47 <tr colspan="2" rowspan="2">
48 <th colspan="2"><font size=6 face="arial black" color="green">CALCULATOR</font></th>
49 </tr>
50
51 <tr>
52 <td width="200" align="center">Enter First Value</td>
53 <td><input type="text" name="first"></td>
54 </tr>
55
56 <tr>
57 <td width="200" align="center">Enter Second Value</td>
58 <td><input type="text" name="second"></td>
59 </tr>
60
61 <tr>
62 <td></td>
63 <th colspan="2">
64 <input type="button" name="add" value=" + ">
65 <input type="button" name="sub2" value=" - ">
66 <input type="button" name="mul" value=" * ">
67 <input type="button" name="div" value=" / ">
68 </th>
69 </tr>
70
71 <tr>
72 <td width="200" align="center">RESULT</td>
73 <td><input type="text" name="result"></td>
74 </tr>
75
76 <tr>
77 <th colspan="2"><input type="button" name="calcbutton" value="CALCULATE">
78 <input type="reset" name="resetbutton" value=" RESET " ></th>
79 </tr>
80
81 </table>
82 </form>
83

qartalonline
جمعه 30 فروردین 1392, 21:52 عصر
کدهاتون کامل نیستند!

mamali-mohammad
جمعه 30 فروردین 1392, 22:38 عصر
مشکلتون چیه ؟