Thursday, March 25, 2021

Increment and Decrement in PHP

 A simple program to demonstrate increment and decrement using PHP programming language.

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 at 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.




Program Listing

<?php
$sum=0;
if(isset($_POST['minus'])){
$sum=$_POST['sum'];
$sum--;
}

if(isset($_POST['add'])){
$sum=$_POST['sum'];
$sum++;
}
?>
<!doctype html>
<html>
<head>
<title>Increment and Decrement in PHP</title>
</head>
<body>
<form method="POST" action="">
<h2>Increment and Decrement in PHP</h2>
<input type="submit" name="minus" value="--"/> 
<input type="text" name="sum" value="<?=$sum;?>" size="1"/> 
<input type="submit" name="add" value="++"/>
</form>
</body>
</html>


No comments:

Post a Comment