Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP PHP Sticky form problem

Have Programming Question? Ask it here!
 
 
 


Mushfiqur Rahman Sajid
PHP Sticky form problem
0 Answer(s)      2 years and 2 months ago
Posted in : PHP


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>

Advertisement
View Answers

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
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
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
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
PHP JavaScript form Validation - PHP
PHP JavaScript form Validation  Just looking for a general PHP JavaScript form Validation. How can I write external JavaScript Validation? Please suggest!  Hi Friend, 1) form Enter Name Enter Address
php loging form connecitivity with mysql
php loging form connecitivity with mysql  my loging form is not connect
Custom Form Validation - PHP
Custom Form Validation  Which is the best way or where should I implement the custom validation rules such as ? using number, capital letters and symbols to secure the password
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 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
PHP Form
PHP Form In this tutorial you will learn how to pass any data from a html page to a php file, and how to use all those data. To do this we need at least two files one is html file and a php file. Here's the given example: userForm.html
Charset problem upon publishing PHP + MySQL website
Charset problem upon publishing PHP + MySQL website  Charset problem upon publishing PHP + MySQL website
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
Problem when resizing the form - Swing AWT
Problem when resizing the form  Hi, I am facing a problem when resizing the form. I have a JTextPane on the JInternalFrame which occupy all the form space at initial stage. we have a button to add a new JTextPane on the form
New Problem in Form Resizing - Swing AWT
New Problem in Form Resizing  Hi, I am using a MDI application...)); The problem is arising when the user resizes the form. The EditorPane(old... the form? This problem is occuring only the components which are added
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('','') ?>
PHP MySQL Login Form
Login Form using PHP and MySQL: In any website generally it is mandatory to have a login form to keep your data secure. In this regard we need to have... will study how to create a login form, connect with the database server and login
PHP HTML Form
PHP & HTML Form: In the current tutorial we will study about PHP and HTML form, we will see how to send HTML . We will combine one html file and PHP...; <BODY> <form method="get" action="<?php $_SERVER
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
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
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
Problem submitting a struts form containing a dojo script - Struts
Problem submitting a struts form containing a dojo script  Hello there, Is there any way to make use of dojo with struts 1 ? Actually, I'm facing a problem submitting a struts form containing a dojo script for a dynamic
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
PHP Form Part-1
Topic : HTML FORM Part - 1  In this tutorial, we will learn how to deal with Html Form, JavaScript Validation, MySQL Database and PHP Scripts. We... start with Html Form : If you have little bit  knowledge about Html
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"> <
PHP Form Part-2
on PHP, so there are several ways to send the form to another page such as PHP..., if you want send it the form to itself in PHP, there is a popular technique...;  To handle the form data efficiently, we can add some PHP script also
PHP Form Part-5
into our php form to get the result. Let's see the following code : Page : 1... will learn how to deal with radio button in php form.  ...Topic : HTML FORM Part - 5 In the previous parts of this tutorial, we covered
form
form   Can I prevent a form from being submitted again
PHP HTML Form Method Attribute
Topic : PHP HTML Form Method Attribute Part - 3 The second attribute in the form tag is Method. With the help of Method attribute, we can tell the browser that how the form information should be sent. Let's see how we used in our form
PHP FORM Part-8
Topic : HTML FORM While Loop Part - 8 In this part of tutorial, we will learn... is false. The syntax for a while loop in PHP is : initialize = value; ... in a better way : <?php $num = 1; while($num<11
PHP HTML Form Submit Button
Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important... of the tutorial then our Html form has covered the action and method attribute. So, here we are going to implement these attributes into our form, in which
PHP FORM Part-10
variable we can store multiple values.  For example of PHP Form Array...Topic : HTML FORM Part - 10: What is an Array  An array is a storage...; array( ); It is enough to tell the PHP that you wanted to set up the array
displaying data for a single column from Mysql database in the list box in php form
displaying data for a single column from Mysql database in the list box in php form  I have a form in php.want to display data from a single column in an listbox in php.thanks..   <?php $data = @mysql_query("select
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 Regular Expression
PHP regular expression allows programmer to perform various task like... expression one can easily validate user form or perform complex manipulations between strings. PHP Regular expression also allows you to validate a email, phone
php
php   what is php   PHP Tutorials
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
php
php  what is php
php
php using javasript  how to set timer in php using javasript
Advertisements
 

 

 

DMCA.com