is the first time I ask for help since I'm stuck in a code for a few days, I looked for tutorials and help online but I could not solve them, so I go to bother them a little while to see if someone can give me a hand.
I'm doing a form in html which then by php shows me the data entered by the user, but my big doubt comes when using the inputs of radio type or checkbox. It wants to show on the screen the data that was saved by printing the item selected by the user but at the same time I also see the other selected options. So far what I could do is show that selected data but duplicating the option. Next I put the code that I am doing outside the project to see if I understand the dynamics. Thank you very much for the help you can give me. Regards!
<form action="pruebaRB.php" name="formPruebaJs" method="post">
<tr>
<td style="text-align: center;">
<input type="radio" name="nombreEmpleado" value="juan" id="nombreEmpleado"> Juan
<input type="radio" name="nombreEmpleado" value="carlos" id="nombreEmpleado"> Carlos <sup>1</sup>
<input type="radio" name="nombreEmpleado" value="luis" id="nombreEmpleado"> Luis <sup>2</sup>
</td>
</form>
<?php
require "conexion.php";
$nombreEmpleado = $_POST["nombreEmpleado"];
$sqlprueba = "INSERT INTO empleado( nombreEmpleado
)
VALUES(
'".$nombreEmpleado."'
)";
$resultadoPrueba = mysqli_query($link,$sqlprueba)
or die( mysqli_error($link));
$chequeo = mysqli_affected_rows($link);
mysqli_close($link);
? >
<input type="radio" name="nombreEmpleado" value=[$nombreEmpleado] checked> <?php echo $nombreEmpleado; ?>
<input type="radio" name="nombreEmpleado" value="juan" id="nombreEmpleado"> Juan
<input type="radio" name="nombreEmpleado" value="Carlos" id="nombreEmpleado"> Carlos
<input type="radio" name="nombreEmpleado" value="Luis" id="nombreEmpleado" > Luis
</td>