How do I add an input type="radio" in a form to the result go to other pages? And when I edit the form does the radio choice continue to be saved?
How do I add an input type="radio" in a form to the result go to other pages? And when I edit the form does the radio choice continue to be saved?
Something like this? But this would be in html, you would like to create a function in PHP that would mount these fields (Sorry I did not understand your proposal very well)?
<form action="#" method="POST">
<input type="radio" name="cor" value="vermelho" <?= isset($_POST['cor']) && $_POST['cor'] === 'vermelho' ? 'checked' : '' ?> >Vermelho
<input type="radio" name="cor" value="azul" <?= isset($_POST['cor']) && $_POST['cor'] === 'azul' ? 'checked' : '' ?> >Azul
<input type="submit" value="Enviar">
</form>
Then you get back like this - > $_POST['cor'];