i have a form as follows

<form action=cbrSearchDetailsProcess.php>

<table width=100% cellpadding=3 cellspacing=5 border=0>

<tr><td align=left>
<font face=tahoma size=2 color=navy>
Preferred Origin :
</font>
</td>
<td align=left>
<SELECT NAME="theORIGIN[]">
<OPTION SELECTED>Any
<OPTION VALUE="Britain">Britain
<OPTION VALUE="France">France
<OPTION VALUE="Germany">Germany
<OPTION VALUE="Italy">Italy
</SELECT>
</td>
<td class="modifyCarTD">Importance</td>
<td class="modifyCarTD"><input type=radio name=theORIGIN_WEIGHT value="1" checked>1</td>
<td class="modifyCarTD"><input type=radio name=theORIGIN_WEIGHT value="2">2</td>
<td class="modifyCarTD"><input type=radio name=theORIGIN_WEIGHT value="3">3</td>
<td class="modifyCarTD"><input type=radio name=theORIGIN_WEIGHT value="4">4</td>
<td class="modifyCarTD"><input type=radio name=theORIGIN_WEIGHT value="5">5</td>
</tr>

.............. etc etc
</table>
</form>

The action you will notice calls cbrSearchDetailsProcess.php
In this file I am trying to recapture the variables. I am suceeding for the drop down boxes but not for the radio buttons... what is wrong with my code?

<?php

$db = mysql_connect("localhost", "d99kd", "secret");
mysql_select_db("d99kd",$db);

foreach($theORIGIN as $thisORIGIN)
{
$o=$thisORIGIN;
}
$theORIGIN_WEIGHT = $o_weight;

?>

Should $o_weight not now hold the value of the radio button?

    I think your php code is wrong because:

    you are assining value from a menu to a variable by the name '$o', and '$o_weight' hasn't been assinged any value, also assinging value of '$o_weight' to '$theORIGIN_WEIGHT ' wont have any effect.

    rather it should be like this:

    $o_weight=$theORIGIN_WEIGHT

    now the $o_weight has the value of the radio button.

    remember the variable on the left is assinged the value of the variable on the right of the '=' mark, meaning a=b means ais assinged value of b.

    check it out! 🆒

      Write a Reply...