[Solved] How to pass radio button value with php [closed]


Quick’n dirty solution :

<?php 
$checked=isset($_POST["radio"]) && $_POST["radio"]==="oneway"?"checked":""; 
?>
<input type="radio" name="radio" id="oneway" value="oneway" <?php echo $checked;?> />

but actually you should separate logic from template using a template engine like smarty or twig or mustache or whatever…

1

solved How to pass radio button value with php [closed]