Test valeur check box en php
Vaaa
-
atspinto Messages postés 338 Date d'inscription Statut Membre Dernière intervention -
atspinto Messages postés 338 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je voudrais tester la valeur d'un checkbox en php pour formulaire.
J'ai un champs check box défini comme ceci en html :
<input type="checkbox" name="syst.info.windows" id="syst.info.windows" />
Et je teste la valeur comme ca
if (isset($_POST['syst.info.windows']))
{
$Systinfowindows = 1;
}else{
$Systinfowindows = 0;
}
Seulement même checkée $Systinfowindows = 0 ...
Une idée ?
Je voudrais tester la valeur d'un checkbox en php pour formulaire.
J'ai un champs check box défini comme ceci en html :
<input type="checkbox" name="syst.info.windows" id="syst.info.windows" />
Et je teste la valeur comme ca
if (isset($_POST['syst.info.windows']))
{
$Systinfowindows = 1;
}else{
$Systinfowindows = 0;
}
Seulement même checkée $Systinfowindows = 0 ...
Une idée ?
A voir également:
- Test valeur check box en php
- Test performance pc - Guide
- Test disque dur - Télécharger - Informations & Diagnostic
- Set-top box - Accueil - Box & Connexion Internet
- Test steam deck oled - Guide
- Test composant pc - Guide
2 réponses
salut
Le pb vient du nom ke tu as donné à ton input.
Une variable ne peut etre nommé ainsi c-à-dir avec des points.
Utilise des "_" à la place.
Essaie ça :
<input type="checkbox" name="syst_info_windows" id="syst_info_windows" />
Et je teste la valeur comme ca
if (isset($_POST['syst_info_windows']))
{
$Systinfowindows = 1;
}else{
$Systinfowindows = 0;
}
Et tu verras ke ça marche.
Le pb vient du nom ke tu as donné à ton input.
Une variable ne peut etre nommé ainsi c-à-dir avec des points.
Utilise des "_" à la place.
Essaie ça :
<input type="checkbox" name="syst_info_windows" id="syst_info_windows" />
Et je teste la valeur comme ca
if (isset($_POST['syst_info_windows']))
{
$Systinfowindows = 1;
}else{
$Systinfowindows = 0;
}
Et tu verras ke ça marche.