Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create an HTML page as shown below by writing PHP script for a simple calculator

ID: 3593539 • Letter: C

Question

Create an HTML page as shown below by writing PHP script for a simple calculator which can perform
the basic operations of addition, subtraction, multiplication, division and mod on the given two numbers
and show result to user. You have to perform the validation check on user input values and show error
message in case if user input give invalid input.
For the given page use internal style CSS with the following details.
h1 color: green
h2 color: red
Box model with background color “lightgrey” and border solid blue.
All text and box should be center aligned
Add footer for your page containing your name and your contact e-mail address as a hyperlink.

a PHP calculator samplex YC Q Search I o s n O R ECCE 5265 Database Engineering and Applications Lab assignmnet Value - 0 Vale 2-0 Operation - Calculate

Explanation / Answer

imdex.html

<head>
<meta charset="utf-8">
<title>Calculator</title>
</head>
<body>
<form method="post" attribute="post" action="disp_form.php">
<p>First Value:<br/>
<input type="text" id="first" name="first"></p>
<p>Second Value:<br/>
<input type="text" id="second" name="second"></p>
<select name="operaion">
<option value="add">+</option>
<option value="subtract">-</option>
<option value="divison">/</option>
<option value="multiply">*</option>
</select>
<button type="submit" name="answer" id="answer" value="answer">Calculate</button>
</form>
</body>
</html>

//disp_form.php

<html>
<body>

<form method="post" attribute="post" action="disp_form.php">
<p>First Value:<br/>
<input type="text" name="first"></p>
<p>Second Value:<br/>
<input type="text" name="second"></p>
<select name="operaion">
<option value="add">+</option>
<option value="subtract">-</option>
<option value="divison">/</option>
<option value="multiply">*</option>
</select>
<button type="submit" name="answer" id="answer" value="answer">Calculate</button>
</form>

<?php
First Value: echo $first = $_POST["first"];
Second Value: echo $second= $_POST['second'];
if($_POST['operaion'] == 'add') {
Result echo $first + $second;
}
else if($_POST['operaion'] == 'subtract') {
echo $first - $second;
}
else if($_POST['operaion'] == 'multiply') {
echo $first * $second;
}
else if($_POST['operaion'] == 'divide') {
echo $first / $second;
}
?>

</html>
</body>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote