How To Create Php Calculator -
Hello friends ajj me apko btaunga ki kis prakar ham php and html ka use karke calculator teyar kar sakte hai very easily.
Yanha me apko two(do) design me alag alag coding karke calculator banana sikhaunga.Dono calculator ka work same hoga.
Used Language-yanha ham 2 language ka use karege html and css aap bootstrap ka use karke ise mobile responsive be bana sakte hai easily.
Feature of calculator-
· Addition
· Minus
· Multiply
· Devide
Calculator 1-
Demo
<?php
if (isset($_POST['submit1'])) {
$x = $_POST['x'];
$y = $_POST['y'];
echo $x + $y;
}
if (isset($_POST['submit2'])) {
$x = $_POST['x'];
$y = $_POST['y'];
echo $x - $y;
}
if (isset($_POST['submit3'])) {
$x = $_POST['x'];
$y = $_POST['y'];
echo $x * $y;
}
if (isset($_POST['submit4'])) {
$x = $_POST['x'];
$y = $_POST['y'];
echo $x / $y;
}
?>
<!DOCTYPE html>
<html>
<body>
<h1> This is my first calculator>
<form method="post">
1st<input type="number" name="x"><br>
2nd<input type="number" name="y"><br>
<button type="submit" name="submit1" value="submit">addition</button>
<button type="submit" name="submit2" value="submit">minus</button>
<button type="submit" name="submit3" value="submit">multiply</button>
<button type="submit" name="submit4" value="submit">devide</button>
</form>
</body>
</html>
Demo
Calculator 2-
yanha me apko ek alag design me calculator bnakar dikhaunga .iska design calculator 1 se bilkul alag ahi but dono ka work same hai calculator karna.
Demo 2
yanha me apko ek alag design me calculator bnakar dikhaunga .iska design calculator 1 se bilkul alag ahi but dono ka work same hai calculator karna.
<?php
if (isset($_POST['submit'])) {
$res1 = $_POST['numb1'];
$res2 = $_POST['numb2'];
$operator = $_POST['operator'];
switch ($operator) {
case 'Add':
echo "Sum: ",$res1 + $res2;
break;
case 'Subtract':
echo $res1 - $res2;
break;
case 'Multiply':
echo $res1 * $res2;
break;
case 'Divide':
echo $res1 / $res2;
break;
}
}
?>
<form method="post">
Enter First Number <input type="number" name="numb1"><br>
Enter Second Number <input type="number" name="numb2"><br>
Selection Operation <select name="operator" id="">
<option>Add</option>
<option>Subtract</option>
<option>Multiply</option>
<option>Divide</option>
</select>
<button type="submit" name="submit" value="submit">Calculate</button>
</form>
Demo 2
Ap in dono calculator ko alag alag files bnakar .php extension ke sath save kar lijiye or apne website me upload kar sakte hai.
App calculator ke demo niche diye gye link se dekh sakte ho –
Thank You
Team Gajabwap Web In Hindi
Also Read-
9 comments
Click here for commentssir I am very thankful for this post nice info sir
Replysir dono He design bdiya hai calculator ke
Replysir ji aapki madad chahiye 9131497044 , 9755795120
Replycall me or give me your no.
my blog www.tips4youme.com
ReplyBro me Apki puri sahayata karunga aap mujhe facebook page Par msg Karo
Replyok sir ji lekin agar aap ek baar call kar lete to badiya ho jata sir mai kuchh sawal hai uske baad aap jab tak khud nahi bolenge mai aap ko call karke pareshan nahi karunga ....
Replypleas sir
Replysir aapka adsence to approve ho gaya , fir aap ye popads ke ad kyo lagaye hai sir......
Replynhi hua yr approve addsense tbhi ye add lgaye hai yr
ReplyConversionConversion EmoticonEmoticon