PHP Sticky form problem

Ads
 

PHP Sticky form problem

I have done the full coding of a sticky form. It is a simple calculator. Whenever I input the value and press "add" or"minus" or "multiply"..etc..etc..and also the reset button the result does not display. Please see my coding below...and advice me what is the problem, and what it need me to done to solve it.

<html>
<head>
<title>Simple Calculator</title>
<?php
    if (isset($_POST['submitted']) && !isset($_POST['reset'])){
        if (isset($_POST['add'])) {
            $add = $_POST['number1'] + $_POST['number2'];
        echo "Add: ".$_POST['number1']." + ".$_POST['number2']." = ".$add;
            }
        }
        if (isset($_POST['minus'])) {

        $minus = $_POST['number1'] - $_POST['number2'];
        echo "Minus: ".$_POST['number1']." - ".$_POST['number2']." = ".$minus;

        } if (isset($_POST['multiply'])) {

        $multiply = $_POST['number1'] * $_POST['number2'];
        echo "Multiply: ".$_POST['number1']." * ".$_POST['number2']." = ".$multiply;

        } if (isset($_POST['divide'])) {

        $divide = $_POST['number1'] / $_POST['number2'];
        echo "Divide: ".$_POST['number1']." / ".$_POST['number2']." = ".$divide;
            }




?>
<script type="text/javascript">


</script>
</head>

<body>
<h1>Simple Calculator</h1>
<form action="simple_calculator.php" method="post">
<p>Number 1: <input type="text" name="number1" size="20" value="<?php if(isset($_POST['number1'])) echo $_POST['number1'];?>"/></p>
<p>Number 2: <input type="text" name="number2" size="20" value="<?php if(isset($_POST['number2'])) echo $_POST['number2'];?>"/></p>

          <input type="button" id="add" value="Add" />
      <input type="button" id="minus" value="Minus" />
      <input type="button" id="multiply" value="Multiply" />
      <input type="button" id="divide" value="Divide" />
      <input type="submit" id="reset" value="Reset" />
         <input type="hidden" id="submitted" value="TRUE" />

            </form>

</body>
</html>
View Answers

Ads









Related Tutorials/Questions & Answers:
PHP Sticky form problem
PHP Sticky form problem  I have done the full coding of a sticky form.... Please see my coding below...and advice me what is the problem, and what... Calculator</title> <?php if (isset($_POST['submitted']) &&
PHP Sticky form problem
PHP Sticky form problem  I have done the full coding of a sticky form.... Please see my coding below...and advice me what is the problem, and what... Calculator</title> <?php if (isset($_POST['submitted']) && !isset
Advertisements
PHP form
PHP form  Hi Sir/Madam, I am developing an attendance form using php... am adding one textfield to enter the Attendance... The problem is I am... form and update them to respective coloumn... Please any one help mo out please
problem on php
problem on php   l have five tables and build them as forms and link between them php and database and i want to build query between them plz help me soon   PHP MySQL Tutorials
php problem
php problem  Hello!! I have a problem ,i want to display the data of a single row in my database,this is the code: <?php</p> include 'connectMySql.php'; $username=$row['username']; if(! $conn ) { die('Could
in php installation problem ?
in php installation problem ?   php installation in 7th step did not display y/n dialog box how to solve the problem
ModuleNotFoundError: No module named 'odoo8-addon-web-form-sticky-header'
ModuleNotFoundError: No module named 'odoo8-addon-web-form-sticky-header' ...: ModuleNotFoundError: No module named 'odoo8-addon-web-form-sticky-header' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-web-form-sticky-header
php form post to mysql
php form post to mysql  How to post data into mysql database from the PHP post data form
HTML to php form
HTML to php form  Hi, How I can submit the HTML form data to PHP Script? Give me example code. Thanks   Hi, Please see the following tutorials: PHP Form PHP email form Thanks
php sql problem - SQL
php sql problem  I ahve a php code that doesn't allow me to get the vat value from db. i tried to add $vat = 21; below $shippingCost = 10... NOW() is problem
php loging form connecitivity with mysql
php loging form connecitivity with mysql  my loging form is not connect
PROBLEM IN FORM VALIDTION
PROBLEM IN FORM VALIDTION  i applied validation IN THIS JSP PAGE.if i... the PROBLEM is that after i press OK on validation prompt,the page goes...; } </script> </head> <body> <form name="form" method="post
Form Processing Problem
Form Processing Problem  I am trying to create a Circular Page... to Null and //as well as the passed data from mulitpart/form-data is greater...; (contentType.indexOf("multipart/form-data") >= 0)) { DataInputStream
Charset problem upon publishing PHP + MySQL website
Charset problem upon publishing PHP + MySQL website  Charset problem upon publishing PHP + MySQL website
PHP Form, PHP guest form
PHP email form HTML form It's not a good idea to leave your private e...'ll create 2 small PHP files, one would send messages, the other... of this project requires about 2 kbs of space on a server that supports PHP. Despite
how to post data in mysql php form
how to post data in mysql php form  how to post data in mysql php form
how to create a user registration form in php
how to create a user registration form in php  how to create a user registration form in php
problem to do coding upload image in php
problem to do coding upload image in php  can i get example coding how to upload image in php?i have try it but i dont no wheter it is correct... . help me please   1)form.html: <html> <body> <form
Problem in enctype="multipart/form-data" in JSP
Problem in enctype="multipart/form-data" in JSP  im using a page... the file itself when i click the submit button. im using enctype="multipart/form-data" in this form. i also using the commons-fileupload-1.2.2.jar file for getting
php form having 2 submit buttons
php form having 2 submit buttons  i have a php form and some text boxes.and 2 buttons"approve" and "disapprove". when i click on approve button the data from form should go in mysql database and mail should go to appropiate
value in div from php, reloading form
value in div from php, reloading form  I am having one form with name... woth other login.php <?php include 'login2.php'; function form($name...; </form> <?php } ?> <?php form('','') ?>
How to implement Captcha in PHP Form using GD Library
How to implement Captcha in PHP Form using GD Library  Hi, How to show Captcha in PHP Form. So, please suggest any online reference so that i will try myself. Thanks
Fetch the data from mysql and display it on php form
Fetch the data from mysql and display it on php form  when i press on login button, after succesful login the related data of that person should be display in other textbox
PHP : Form to Email
PHP : Form to Email       With the help of this tutorial you can send mails to a user using a form, as we have discussed in our earlier tutorial, it is very easy to send mails using PHP and any
How to Create Login/ Registration Form using PHP and MYSQL
How to Create Login/ Registration Form using PHP and MYSQL  Hi, I am learning PHP. I have some dilemma how to create a Login Form and make connectivity with HTML page using PHP and MYSQL. Is there any body can guide me
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
ModuleNotFoundError: No module named 'sticky'
ModuleNotFoundError: No module named 'sticky'  Hi, My Python... 'sticky' How to remove the ModuleNotFoundError: No module named 'sticky'... to install padas library. You can install sticky python with following command
php
php  plz tell me code for PHP SQL Insert,delete,update,view is used to insert the record from HTML page to Mysql database using in single PHP form
php
php  im beginner to php. i faced problem with creating form and data...;head> <title>Form Input Data</title> </head> <body> <table border="1"> <tr> <td align="center">Form
php
php  im beginner to php. i faced problem with creating form and data...;head> <title>Form Input Data</title> </head> <body> <table border="1"> <tr> <td align="center">Form

Ads