Showing posts with label product of two numbers in php. Show all posts
Showing posts with label product of two numbers in php. Show all posts

Sunday, October 20, 2019

Product of Two Numbers in PHP

I simple program that I wrote using PHP to compute the product of two numbers and display the result on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.


Sample Program Output


Program Listing

index.php

<?php

$a = 5;
$b = 10;

$product = ($a * $b);

echo "<h1> The product of $a and $b is $product.";

?>




Sunday, March 5, 2017

Product of Two Numbers in PHP

In this article I wrote a simple program to ask the user to give two numbers and then our program will compute the product of the two numbers given by our user using PHP. The code is very simple and easy to understand you will learn how to use HTML forms to accept and process the values from the user.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

<?php
error_reporting(0);

$a =$_POST['num1'];
$b =$_POST['num2'];

if (isset($_POST['ok']))
{
$result= $a * $b;
}

if (isset($_POST['clear']))
{
$a="";
$b="";
$result= "";
}

?>
<html><body>
<style>
body {
background-color:lightgreen;
font-family:arial;
font:12px;
}
</style>

<form action="index.php" method="post">
<h3> Product of Two Numbers in PHP </h3>
<br>
Value No. 1 : &nbsp;&nbsp;  <input name="num1" value="<?php echo $a ?>" autofocus required> <br><br>
Value No. 2 : &nbsp;&nbsp;  <input name="num2" value="<?php echo $b ?>" required>
<br><br>
Answer      : &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  
             <input value="<?php if (isset($result)) echo $result ?>" readonly>
<br><br>
<input type="submit" name="ok" value="Ok" title="Click here to find the product.">
&nbsp;&nbsp;&nbsp;
<input type="submit" name="clear" value="Clear" title="Click here to clear the text box.">
</form>
</body></html>