Notice: Undefined index:...
Posté : 06 juil. 2012, 18:33
Bonjour,
Je suis débutant, enfaite je creer un formulaire en html et en appuyant sur envoyer il me creer un fichier texte avec les données,
mais des que un champ est vide ou un checkbox est non cocher j'ai le message la qui s'affiche" Notice: Undefined index:..."
Je mit une valeur par défaut sur les champs texte
mais sa na rien changer comment je peut faire pour les corrigé je mit de valeur
<?php
$nom = $_POST['nom'];
$tel = $_POST['tel'];
$mdp = $_POST['mdp'];
$mrq = $_POST['mrq'];
$choix1 = $_POST['choix1'];
$choix2 = $_POST['choix2'];
$choix3 = $_POST['choix3'];
$choix4 = $_POST['choix4'];
$choix5 = $_POST['choix5'];
$choix6 = $_POST['choix6'];
$choix7 = $_POST['choix7'];
$choix17 = $_POST['choix17'];
$choix18 = $_POST['choix18'];
$choix19 = $_POST['choix19'];
$choix20 = $_POST['choix20'];
$focus = $_POST['focus'];
$devis=$_POST['devis'];
// traitement creation du fichier *odt
if($fp = fopen("C:\Users\pasdenom2\Documents\Kalifa\Fiche de prise en charge\Tous les fiche/$nom.odt","w+")) /* ouverture du fichier en écriture !c'est la ligne 17 */
{
fputs($fp, "\n"); // on va a la ligne
// on écrit le nom et email dans le fichier
fputs($fp, "Nom du Client: $nom
Tel: $tel
Mot de passe: $mdp
Marque: $mrq
Type: $choix17 $choix18
Sauvegarde: $choix19 $choix20 $focus
Description du Problème:
L'ordinateur$choix1$choix2$choix3$choix4$choix5$choix6
$choix7:$devis
");
fclose($fp);
}
?>
Je suis débutant, enfaite je creer un formulaire en html et en appuyant sur envoyer il me creer un fichier texte avec les données,
mais des que un champ est vide ou un checkbox est non cocher j'ai le message la qui s'affiche" Notice: Undefined index:..."
Je mit une valeur par défaut sur les champs texte
mais sa na rien changer comment je peut faire pour les corrigé je mit de valeur
<?php
$nom = $_POST['nom'];
$tel = $_POST['tel'];
$mdp = $_POST['mdp'];
$mrq = $_POST['mrq'];
$choix1 = $_POST['choix1'];
$choix2 = $_POST['choix2'];
$choix3 = $_POST['choix3'];
$choix4 = $_POST['choix4'];
$choix5 = $_POST['choix5'];
$choix6 = $_POST['choix6'];
$choix7 = $_POST['choix7'];
$choix17 = $_POST['choix17'];
$choix18 = $_POST['choix18'];
$choix19 = $_POST['choix19'];
$choix20 = $_POST['choix20'];
$focus = $_POST['focus'];
$devis=$_POST['devis'];
// traitement creation du fichier *odt
if($fp = fopen("C:\Users\pasdenom2\Documents\Kalifa\Fiche de prise en charge\Tous les fiche/$nom.odt","w+")) /* ouverture du fichier en écriture !c'est la ligne 17 */
{
fputs($fp, "\n"); // on va a la ligne
// on écrit le nom et email dans le fichier
fputs($fp, "Nom du Client: $nom
Tel: $tel
Mot de passe: $mdp
Marque: $mrq
Type: $choix17 $choix18
Sauvegarde: $choix19 $choix20 $focus
Description du Problème:
L'ordinateur$choix1$choix2$choix3$choix4$choix5$choix6
$choix7:$devis
");
fclose($fp);
}
?>