j'ai un probleme:dans la page s'affiche un notice
Notice: Undefined index:x in y.php on line ttt
s il vous plais aider moi a remedier a ça
et merci d avance
A la ligne "ttt" de ton script "y.php" tu utilises sans doute un tableau en faisant appel à l'index "x" alors que cet index n'existe pas.Notice: Undefined index:x in y.php on line ttt
Ton problème vient de $_POST['student']. En effet, quand tu arrives sur la page pour la première fois, ton formulaire n'a pas encore été soumis et donc ta variable $_POST ne contient pas d'index "student"voici mon code
$studoptions = '<input name="student" type="radio" value="T">Yes <input name="student" type="radio" value="F">No';
if ($_POST['student'] == "T") { print ereg_replace("value="T"","value="T" checked",$studoptions); }
et la notice
Notice Undefined index student in soumis.php on line 262
et merci encore
$studoptions = '<input name="student" type="radio" value="T">Yes
<input name="student" type="radio" value="F">No';
if (isSet($_POST['student']) && $_POST['student']=="T") { // si $_POST['student'] est défini ET égal à "T"
print ereg_replace("value="T"","value="T" checked",$studoptions); // on coche le bouton radio
}