You can detect which radio button was checked using the concept of the following:
Procedure for 'Form Validation' when radio buttons are involved.
Example:
Step I. In essence, initialize the following vars when the page loads. These values will be used later.
// Create a Form Validation Process Variable called '$op'. Initialize it at the time the form page is loaded for the first time (or refreshed).
$op = "initialize";
// NOTE -- The $op var will change to $op = "validate" after the form is filled out and the 'Submit' button is clicked.
// After the form has been filled out correctly (all fields have been checked - it could take any number of tries by the person filling out the form because the $op var will not change to 'proceed' until all field checking is satisfied.
// Therefore, after all data in the fields have been filled out correctly and all criteria for radio buttons and check boxes, etc. have been satisfied, then the $op var will change to $op = "proceed" upon clicking the 'Submit' button again. If the form was filled out satisfactorily the first-go-round, the $op var would have changed to 'proceed' as soon as the 'Submit' button was clicked the first time.
// Next, initialize the radio buttons
$new_client_checked = "";
$existing_client_checked = "";
// Also, initialize the 'ACTION' var in the <form> tag
// The form tag will be <form METHOD=POST ACTION=$form_action>
// The ACTION will remain $PHP_SELF until the $op
$form_action = "$PHP_SELF";
Note: Place these php statements at the top of the form page, before the HTML.
Step II.
// In the 'if ($op == "validate")', the 'test' will be for the existence of a value for the radio button var which is the 'name' used in the <INPUT type=radio name=radio_button Value=\"button1\" $radio_button1_checked>BUTTON#1 statement. Create statements similar to <INPUT type=radio name=radio_button Value=\"button2\" $radio_button2_checked>BUTTON#2 for each radio button.
// If the radio button selected by the person filling out the form is e.g. button 1, then the variable for $radio_button will become "button1" once the 'Submit' button is clicked.
// To check the value, you could include a statement such as the one below that displays the value of the radio button that was checked
echo "<b><font color=\"#FF00FF\">The required client var is $required_client</font></b><p>";
if ($radio_button == "button1")
{
$radio_button1_checked = "CHECKED";
}
elseif ($radio_button == "button2")
{
$radio_button2_checked = "CHECKED";
}
// Depending on the 'if' statement above that was 'true', the value of the 'checked' var will be stored inside of the corresponding var in the <INPUT...> statement. That var will either store the word "CHECKED" to satisfy the HTML criteria for indicating a 'selected' radio button, or the value of the var will maintain its initialized value which was "". The 'HTML' statements that house the form should be located after the above 'php block'.
With the essence of this procedure, the value of the radio button will remain checked if the visitor needs to modify the form before it is ready to be sent according to the 'conditional' $form_action (you need another 'if' routine that will evaluate the value of the '$op' var. If ($op == "proceed"), then set the value of $form_action equal to the 'php' page you want to pass the varibles to via the 'POST' (or GET, if desired) method.
+++++++++++++++++++++
That shown above is described in general terms. I will leave it up to the reader to refine it and customize it to their application.
...Hope this helps.
Sherry