I have this code of PHP:
<form action="modificaPriorita.php" method="post">
<table>
<tr id="format-tabelle">
<th></th>
<th><span class="format-celle">TITLE</span></th>
<th><span class="format-celle">TYPE</span></th>
</tr>
<?php
$res = GestioneSegnalazione::showSegnalazioni();
function drawTable($res) {
$title = $res[0];
$idAuthor = $res[1];
$type = $res[2];
for ($i = 0; $i < $num; $i++) {
print "<tr class='row'>
<td align='center' valign='middle'> <input type='radio' name='radio' value='$title[$i],$idAuthor[$i]'/> </td>
<td align='center' valign='middle'><span class='format-celle'> $title[$i]</span></td>
<td align='center' valign='middle'><span class='format-celle'> $type[$i]</span></td>
?>
</table>
<br>
<input type="submit" name="show" value="Show" class='freshbutton-orange' id='show-submit-segnalazione'/>
<?
if (isset($_POST['show'])) {
if ($_POST[radio] == "") {
echo("<SCRIPT JavaScript'>window.alert('Select one segnalazione to show');window.location.href='showSegnalazione.php#close'</SCRIPT>");
}
}
?>
If i select one item in radio button and i press the button 'show' it works, it goes to the other page "modificaPriorita.php" with two parameters: title, idAuthor My problem is if i press the 'show' button without select one item in radio button, it would show me the error 'Select one segnalazione to show', but it goes to the new page ("modificaPriorita.php") without parameters. what can i do to have this error message?