Ver Mensaje Individual
  #17 (permalink)  
Antiguo 04/10/2013, 06:54
Avatar de NSD
NSD
Colaborador
 
Fecha de Ingreso: mayo-2012
Ubicación: Somewhere
Mensajes: 1.332
Antigüedad: 12 años
Puntos: 320
Respuesta: Enviar una opcion de un html a otro html

porque estas haciendo mal el foreach, seria asi:
Código PHP:
Ver original
  1. <?php  
  2. for($i = 1; $i<4; $i++){
  3. if($_GET['opcion'] == $i){
  4. $value='checked';
  5. }else{
  6. $value='';
  7. }
  8.     echo '<input type="radio" name="radio-set-'.$i.'" checked="'.$value.'" >';
  9. }
  10. ?>
o en su vercion inline:
Código PHP:
Ver original
  1. <?php  
  2. for($i = 1; $i<4; $i++){
  3.     echo '<input type="radio" name="radio-set-'.$i.'" checked="'.($_GET['opcion'] == $i ? 'checked' : '').'" >';
  4. }
  5. ?>
__________________
Maratón de desafíos PHP Junio - Agosto 2015 en FDW | Reglamento - Desafios