I am trying to print the selected radio button value on a new page - my code looks as follows
function printUserApplicationSelectionForm($applicationsForUser){
?>
<form action="test.php" method="post">
<?php
foreach ($applicationsForUser as $app) {
$name = $app->getName();
$appId = $app->getApplicationId();
?>
<input type="radio" name="appNames" value="<?php $appId ?>"> <?php echo $name ?> <br>
<?php
}
?>
<input type="submit" name="submitRadio" value="Submit"><br>
</form>
<?php
}
<?php
if(isset($_POST['submitRadio'])){
$selected_radio = $_POST['appNames'];
echo "1234";
}else{
echo "is not";
}
?>
If i print explicit values like 1234 it prints without an issue- however printing $selected_radio
does not - why would this variable be empty?
Thanks