php coding logic for a button
<p>php code</p>

<pre><code>if(isset($_POST['txtLocation']))
{
    $choice_loc = $_POST["txtLocation"];
}
elseif(!isset($_POST['txtLocation']))
{
    $message = "Please select the desired location or click on default";
}
elseif($choice_loc == "txtSetXY")
{
    $x = $_POST["txtXLocation"];
    $y = $_POST["txtYLocation"];
    if($x == "")
    {
        $message = "You forget to enter X location.";
    }
    elseif($y == "")
    {
        $message = "You forget to enter Y location.";
    }
    else
    {
        $choice_loc = $x . "," . $y;
    }
}
</code></pre>

<p>This is html form</p>

<pre><code>&lt;div class="formText"&gt;
  &lt;input type="radio" name="txtLocation" value="txtSetXY"/&gt; Specify Location&lt;br /&gt;
  &lt;div style="padding-left:20px;"&gt;
       X: &lt;input type="text" id="locField" name="txtXLocation"&gt;
       Y: &lt;input type="text" id="locField" name="txtYLocation"&gt;
   &lt;/div&gt;
   &lt;input type="radio" name="txtLocation" value="Default" checked="checked"/&gt;Default
&lt;/div&gt;
</code></pre>

<p>What is the error in logic?? </p>

<p>value "default" is entered into database, but when selected <code>value="txtSetXY"</code> radio and entering x and y values in textfields it is not entering into database?</p>

<p>this is my database entering query</p>

<pre><code>$insert = "INSERT INTO dbform (dblocation) VALUES ('{$choice_loc}')";
</code></pre>
