• 0
Sign in to follow this  
tsan

alguém Saberia Onde Está O Erro?

Question

Tipo fiz um select que recebe $facu de uma pagina por POST , e tem varios campos que posso alterar , e só esse campo select que dá erro, qd eu altero a $facu da outra pagina(o $facu está recebendo certinho), aparece esses codigos escritos, não os select bonitinhu e tal..................... está meio confuso mas c alguém não entendeu me pergunte o que...

valeu,

DIE ("

<td align='RIGHT'> $FONT Unidade/Trabalho:</td>

<td colspan=3>

<?php

$fc1 = '<input type='radio' name='facu' value='FMRP'>'.'FMRP';

$fc2 = '<input type='radio' name='facu' value='FFCLRP'>'.'FFCLRP';

$fc3 = '<input type='radio' name='facu' value='FEA'>'.'FEA';

$fc4 = '<input type='radio' name='facu' value='EERP'>'.'EERP';

$fc5 = '<input type='radio' name='facu' value='FORP'>'.'FORP';

$fc6 = '<input type='radio' name='facu' value='FCFRP'>'.'FCFRP';

$fc7 = '<input type='radio' name='facu' value='ECA'>'.'ECA';

if ($facu=='') echo $fc1.$fc2.$fc3.$fc4.$fc5.$fc6.$fc7;

else if ($facu=='FMRP')

echo '<input type='radio' name='facu' value='FMRP'checked>'.'FMRP'.$fc2.$fc3.$fc4.$fc5.$fc6.$fc7;

else if ($facu=='FFCLRP')

echo $fc1.'<input type='radio' name='facu' value='FFCLRP' checked>'.'FFCLRP'.$fc3.$fc4.$fc5.$fc6.$fc7;

else if ($facu=='FEA')

echo $fc1.$fc2.'<input type='radio' name='facu' value='FEA' checked>'.'FEA'.$fc4.$fc5.$fc6.$fc7;

else if ($facu=='EERP')

echo $fc1.$fc2.$fc3.'<input type='radio' name='facu' value='EERP' checked>'.'EERP'.$fc5.$fc6.$fc7;

else if ($facu=='FORP')

echo $fc1.$fc2.$fc3.$fc4.'<input type='radio' name='facu' value='FORP' checked>'.'FORP'.$fc6.$fc7;

else if ($facu=='FCFRP')

echo $fc1.$fc2.$fc3.$fc4.$fc5.'<input type='radio' name='facu' value='FCFRP' checked>'.'FCFRP'.$fc7;

else if ($facu=='ECA')

echo $fc1.$fc2.$fc3.$fc4.$fc5.$fc6.'<input type='radio' name='facu' value='ECA' checked>'.'ECA';

?>

</td>

</tr> ");

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Dessa forma não é possível fazer, tente algo do tipo:

<?php
if (condicao que executaria o DIE) {
?>
  <td align='RIGHT'><?php echo $FONT ?> Unidade/Trabalho:</td>
  <td colspan=3> 
<?php
  $fc1 = '<input type='radio' name='facu' value='FMRP'>'.'FMRP';
  $fc2 = '<input type='radio' name='facu' value='FFCLRP'>'.'FFCLRP';
  $fc3 = '<input type='radio' name='facu' value='FEA'>'.'FEA';
  $fc4 = '<input type='radio' name='facu' value='EERP'>'.'EERP';
  $fc5 = '<input type='radio' name='facu' value='FORP'>'.'FORP';
  $fc6 = '<input type='radio' name='facu' value='FCFRP'>'.'FCFRP'; 
  $fc7 = '<input type='radio' name='facu' value='ECA'>'.'ECA';

  if ($facu=='')
    echo $fc1.$fc2.$fc3.$fc4.$fc5.$fc6.$fc7; 
  elseif ($facu=='FMRP') 
    echo '<input type='radio' name='facu' value='FMRP'checked>'.'FMRP'.$fc2.$fc3.$fc4.$fc5.$fc6.$fc7; 
  elseif ($facu=='FFCLRP') 
    echo $fc1.'<input type='radio' name='facu' value='FFCLRP' checked>'.'FFCLRP'.$fc3.$fc4.$fc5.$fc6.$fc7;
  elseif ($facu=='FEA') 
    echo $fc1.$fc2.'<input type='radio' name='facu' value='FEA' checked>'.'FEA'.$fc4.$fc5.$fc6.$fc7; 
  elseif ($facu=='EERP') 
    echo $fc1.$fc2.$fc3.'<input type='radio' name='facu' value='EERP' checked>'.'EERP'.$fc5.$fc6.$fc7; 
  elseif ($facu=='FORP') 
    echo $fc1.$fc2.$fc3.$fc4.'<input type='radio' name='facu' value='FORP' checked>'.'FORP'.$fc6.$fc7;
  elseif ($facu=='FCFRP')
    echo $fc1.$fc2.$fc3.$fc4.$fc5.'<input type='radio' name='facu' value='FCFRP' checked>'.'FCFRP'.$fc7;
  elseif ($facu=='ECA')
    echo $fc1.$fc2.$fc3.$fc4.$fc5.$fc6.'<input type='radio' name='facu' value='ECA' checked>'.'ECA';
?>
  </td>
</tr>
<?php
  // o segredo é aqui...
  exit; // termina o script (PHP) atual
} // end do if
?>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this