post problem with dynamically created option buttons

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

post problem with dynamically created option buttons

Post by shiranwas »

hi,,

i have a php page whih adds some data to a table from a database, in the table first column when the data adds it will be a option button with the value of the batabase field.
the table is creating fine but when i submit the value of the option button to anoter php page with post the value is not set what is the problem with my code pls ome one help me

Code: Select all

echo "<table>";

while($rows=mysql_fetch_row($uqery)){			

echo "<tr bgcolor='E2F3F1' onClick='alert()'>";							
echo "<font size=1>	";
echo "<td height='5'><input name='optSelected' type='radio' value='.$rows[0].'></td>";
echo "<td height='5'>".$rows[0]."</td>";
echo "<td height='5'>".$rows[1]."</td>";
echo "<td height='5'>".$rows[2]."</td>";
echo "<td height='5'>".$rows[3]."</td>";
echo "<td height='5'>".$rows[4]."</td>";
echo "</font>";
echo "</tr>";		
$count=$count+1;		
						
}								
echo "</table>";

shiran
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

echo "<td height='5'><input name='optSelected' type='radio' value='.$rows[0].'></td>";
Take a closer look at this line. Especially the dots.

Tip: the syntax highlighter here made them red, while the dots in the following lines are not.
Post Reply