Bonjour,
J'ai un problème avec un sélect. Le contenu est toujours égal à N sauf pour vu_ca.
Si l'option est cochée, je voudrais O, sinon N
Merci de votre aide!
Code :
- <tr height="50px">
- <td align="center" valign="center"><strong>Vue par</strong></td>
- <td valign="center">
- <input type="checkbox" class="radio" name="vu_tous" value="O" id="5" checked></input>
- <label for="5">Tous</label>
- <input type="checkbox" class="radio" name="vu_ca" value="" id="6"></input>
- <label for="6">CA</label>
- <input type="checkbox" class="radio" name="vu_ent" value="N" id="7"></input>
- <label for="7">Entraîneur</label>
- <input type="checkbox" class="radio" name="vu_ger" value="N" id="8"></input>
- <label for="8">Gérant</label>
- <input type="checkbox" class="radio" name="vu_jou" value="N" id="9"></input>
- <label for="9">Joueur</label>
- <input type="checkbox" class="radio" name="vu_ct" value="N" id="10"></input>
- <label for="10">Comité tech.</label>
- <input type="checkbox" class="radio" name="vu_ben" value="N" id="11"></input>
- <label for="11">Bénévole</label>
- <input type="checkbox" class="radio" name="vu_arb" value="N" id="12"></input>
- <label for="12">Arbitre</label>
- <input type="checkbox" class="radio" name="vu_emp" value="N" id="13"></input>
- <label for="13">Employé</label>
- </td>
- </tr>
- <tr height="50px">
- <td align="center" valign="center"></td>
- <td align="center">
- <input type="submit" name="submit" value="Ajouter" style="width:100"></input>
- <input type="reset" name="submit" value="Annuler" style="width:100"></input>
- </td>
- <tr>
- </form>
- </center>
- <?
- }
- elseif($_POST['submit']) {
- $titre = secure($_POST['titre']);
- $texte = secure($_POST['texte']);
- $texte = nl2br($texte);
- $newsletter = secure($_POST['newsletter']);
- if(!empty($_POST['commentaires'])) { $commentaires = secure($_POST['commentaires']); } else { $commentaires = ""; }
- if(!empty($_POST['vu_tous'])) { $vu_tous = secure($_POST['vu_tous']); } else { $vu_tous = "N"; }
- if(!empty($_POST['vu_ca'])) { $vu_ca = secure($_POST['vu_ca']); } else { $vu_ca = "N"; }
- if(!empty($_POST['vu_ent'])) { $vu_ent = secure($_POST['vu_ent']); } else { $vu_ent = "N"; }
- if(!empty($_POST['vu_ger'])) { $vu_ger = secure($_POST['vu_ger']); } else { $vu_ger = "N"; }
- if(!empty($_POST['vu_jou'])) { $vu_jou = secure($_POST['vu_jou']); } else { $vu_jou = "N"; }
- if(!empty($_POST['vu_ct'])) { $vu_ct = secure($_POST['vu_ct']); } else { $vu_ct = "N"; }
- if(!empty($_POST['vu_emp'])) { $vu_emp = secure($_POST['vu_emp']); } else { $vu_emp = "N"; }
- if(!empty($_POST['vu_arb'])) { $vu_arb = secure($_POST['vu_arb']); } else { $vu_arb = "N"; }
- if(!empty($_POST['vu_ben'])) { $vu_ben = secure($_POST['vu_ben']); } else { $vu_ben = "N"; }
- echo 'CA : '.$vu_ca;
|
Message édité par fourniey le 02-02-2008 à 01:44:20