So when I click on a radio tick I want the specific value to be sent to the file 'testview.php' and then echo it out. However, I have a while statement/loop that grabs out all the data in the table 'album' and the rows would include the following: path1, path2, path3 etc but when I click on the path1 radio tick it displays the necessary information but when I click path2 it shows the same information from path1. Below is the codes and can someone please help?
Thank you.
<div class="albumwrapper">
<form action="testview.php" method="post">
<table>
<?php
$select_album_names = "SELECT * FROM albums WHERE user_id = '$session_user_id'";
$album_names = mysql_query($select_album_names);
while($display_album_names = mysql_fetch_array($album_names))
{
echo "<tr><td>".'<input type="radio" name="field" id="radio1" value="'.$display_album_names['path'].'" onclick="this.form.submit();">'.'<label for="radio1">'.$display_album_names['name'].'</label>'."</td></tr>";
}
?>
</table>
</form>
</div>
<div id='imagedest'>
</div>
//testview.php
<?php
echo $_POST['field'];
?>