I have built a table in PHP to display a list of people and data relating to them. I want the user to be able to select one of those users to send an e-mail request to. So I have put a button at the end of each row for every user.
Im not sure how to write the PHP script to identify which button has been pressed. I have tried assigning the name of the button to be the e-mail address of the user for the row but I dont know how to read that value in the corresponding script...
Code for initial page:
if ($query_run = mysql_query($query))
{
echo "<fieldset>";
echo "<table>";
while ($row = mysql_fetch_assoc($sqldata))
{
echo "<tr><th>Name</th>";
echo "<td>";
echo $row['FirstName']." ".$row['LastName'];
echo "<td>";
echo $row['Country'];
echo "<td>";
echo $row['Profile'];
echo "<td>";
echo $row['Email'];
$Email = $row['Email'];
echo "<td>";
echo '<input type = "submit" name="$Email" value="connect">';
}
echo "</table>";
echo "</fieldset>";
Thanks!