Php
Best Codes
Login
Username or email
Password
Sign in
Forgot your password?
Sign up
Why sign up?
- One account for five websites!
- Free access to Premium Codes
- Acess to cool web tools
- Ask and answer questions
- Stay ahead of other web developers
- and MUCH MORE!
Username
Password
Email
Sign up
JavaScript Codes
HTML Free Codes
HTML Codes
PHP Scripts
Logo Graphic
Developer Codes
Home
Links
Sitemap
About Us
Feel The Power
Php Code:
Adding two numbers function
Previous Code
Next Code
Adding two numbers and return the result.
<html> <head> <style type="text/css"> #add{margin-left:200px;} #tit{color:red;margin-left:50px;margin-top:20px;font-family:Arial;font-size:30px;} .num{font-family:Budoni;color:green;} #res{color:blue;font-family:Sans-serif;margin-left:50px;} #result{color:red;width:70px;} </style> </head> <body> <?php $num1="0"; $num2="0"; $res="0"; if(!empty($_POST["num1"]) && !empty($_POST["num2"]) ){ $num1=$_POST["num1"]; $num2=$_POST["num2"]; $res=$num1+$num2; } ?> <form method="post"> <label id="tit">| Adding Two numbers using php Function |</label> <br/><br/> <label class="num">Input 1st number : <input type="text" name="num1" value="<?php echo $num1; ?>";/></label><br/><br/> <label class="num">Input 2nd number : <input type="text" name="num2" value="<?php echo $num2; ?>" /></label> <br/><br/> <input type="submit" value="ADD" id="add"/> <input type="reset" value="reset"> </form> <label id="res">RESULT : <input type="text" value="<?php echo $res; ?>" disabled="yes" id="result" /></label> </body> </html>
If you don't know how to use this code or need more information
Click here
!
Links
Javascript Codes
HTML Best Codes
HTML5 Codes
Logo Graphic Design
Developer Code
Frontend Free Code
VISITORS
Online Users:
6
Total Online Users:
18
Recent Members:
Kennethalach, aitorsol, maya, AndrewNut, Walterquone
FIND US
LINK US
Link to us:
Please put this code in your page.