Suppose you wanted to create a form that allows the user to enter two numbers and an operation, and then a PHP script that performs the operation on the numbers.
First, you have to create a form which would look like this
(you can try it to see how the example works):
|
|
To do this in Dreamweaver, first you set the "Form Properties" for the form:

Next, you need to insert 2 textfields and set their properties as follows: the image below shows the properties for the first textfield where you would assign it a name of number1.

Then, you need to add 4 radio buttons and set their properties as follows (the image below shows the properties for 2 of the radio buttons):

Note that they have the same name and different values. Because only one operation will be selected, so the name of the RadioButton would hold only one value.
Finally, you need to insert a submit button from the form objects menu.
Here is the HTML code for the form (for readability, I have omitted the <p>
and </p> tags, which indicate
line breaks in the output):
<form method="get" action="action.php"> |
Here is the PHP script that detects the operation (by checking the value of the variable $op) and performs the specific operation. Note that only one operation would be executed.
<?php
if ( $op == "add" ) {
|