Formulaire, récupérer les données
jessik_j7@sympatico.ca
Messages postés
10
Statut
Membre
-
jessik_j7@sympatico.ca Messages postés 10 Statut Membre -
jessik_j7@sympatico.ca Messages postés 10 Statut Membre -
Bonjour,
J'ai un problème avec mon formulaire et je veux m'arracher les cheveux. Est-ce que quelqu'un peu m'aider??
Le seule problème que j'ai, c'est d'être capable de récupérer les données. Je suis novice dans la programmation, donc voici le code de mon formulaire:
<table width="704" border="3" cellspacing="2" cellpadding="0" align="center">
<tr height="23">
<td height="23"><input id="ID_checkboxName_1C91CFC18A89ED0" type="checkbox" name="Site internet complet" value="Site internet complet" /><label for="ID_checkboxName_1C91CFC18A89ED0"><font color="#cc00cc"><strong>Site Web (complet)</strong></font>l</label></td>
<td width="242" height="23"><input id="ID_checkboxName_1C91CFC1D8C4C80" type="checkbox" name="site web graphisme seulement" value="site web graphisme seulement" /><label for="ID_checkboxName_1C91CFC1D8C4C80"><font color="#cc00cc"><strong>Site Web (graphisme seulement)</strong></font>l</label></td>
<td width="70" height="23"></td>
<td width="95" height="23"></td>
</tr>
<tr height="18">
<td height="18"><input id="ID_checkboxName_1C91CFCFCED0D60" type="checkbox" name="Pub courriel" value="Pub courriel" /><label for="ID_checkboxName_1C91CFCFCED0D60"><font color="#cc00cc"><strong>Pub courriel</strong></font></label></td>
<td width="242" height="18"><input id="ID_checkboxName_1C91CFDCF69500" type="checkbox" name="concept logo" value="concept logo" /><label for="ID_checkboxName_1C91CFDCF69500"><font color="#cc00cc"><strong>Concept logo</strong></font></label></td>
<td width="70" height="18"></td>
<td width="95" height="18"></td>
</tr>
<tr height="18">
<td height="18"><input id="ID_checkboxName_1C91CFD103A710" type="checkbox" name="Bannière" value="Bannière" /><label for="ID_checkboxName_1C91CFD103A710"><font color="#cc00cc"><strong>Bannière de pub internet</strong></font>l</label></td>
<td width="242" height="18"><input id="ID_checkboxName_1C91CFD12DBAD20" type="checkbox" name="Cartes d'affaires" value="Cartes d'affaires" /><label for="ID_checkboxName_1C91CFD12DBAD20"><font color="#cc00cc"><strong>Cartes d'affaires</strong></font></label></td>
<td width="70" height="18"></td>
<td width="95" height="18"></td>
</tr>
<tr height="18">
<td height="18"><input id="ID_checkboxName_1C91CFD390E1A0" type="checkbox" name="imprimé" value="imprimé" /><label for="ID_checkboxName_1C91CFD390E1A0"><font color="#cc00cc"><strong>Imprimé</strong></font></label></td>
<td width="242" height="18"><input id="ID_checkboxName_1C91CFD1593EF50" type="checkbox" name="Affiche" value="Affiche" /><label for="ID_checkboxName_1C91CFD1593EF50"><font color="#cc00cc"><strong>Affiche, banderole, etc.</strong></font>l</label></td>
<td width="70" height="18"></td>
<td width="95" height="18"></td>
</tr>
<tr height="19">
<td height="19"></td>
<td width="242" height="19"><label for="ID_textfieldName_1C91CFD18AB6880"><input type="checkbox" name="Autres" value="Autres" /><font color="#cc00cc"><strong>Autres</strong></font></label><input id="ID_textfieldName_1C91CFD18AB6880" type="text" name="Autres" value="Autres" size="24" maxlength="50" /></td>
<td width="70" height="19"></td>
<td width="95" height="19"></td>
</tr>
<tr height="37">
<td height="37"><label for="ID_type de payment_1C91CF3E3A9240"><font color="#cc00cc"><strong>Mode de payment</strong></font></label></td>
<td width="242" height="37"><input id="ID_type de payment_1C91CF3E3A9240" type="radio" name="type de payment" value="Virement" checked="checked" /><strong><font color="#cc00cc">Virement bancaire</font></strong></td>
<td width="70" height="37"><font color="#cc00cc"><input id="ID_type de payment_1C91CF3CA09150" type="radio" name="type de payment" value="Paypal" /><strong>Paypal</strong></font></td>
<td width="95" height="37"><font color="#cc00cc"><strong><input type="radio" name="type de payment" value="autres" /> Autres</strong></font></td>
</tr>
<tr height="26">
<td height="26"><strong><label for="ID_nom_1C91CEED258A9F0"><font color="#cc00cc"><strong>Nom</strong></font></label></strong></td>
<td width="242" height="26"><input id="ID_nom_1C91CEED258A9F0" type="text" name="nom" value="Tapez votre nom ici" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Prénom_1C91CEF1684E760"><strong><font color="#cc00cc">Prénom</font></strong></label></td>
<td width="242" height="26"><input id="ID_Prénom_1C91CEF1684E760" type="text" name="Prénom" value="Tapez votre prénom ici" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_nom d'entreprise_1C91CEF1D587E30"><font color="#cc00cc"><strong>Nom de l'entreprise(numéro s'il y a lieu)</strong></font></label></td>
<td width="242" height="26"><input id="ID_nom d'entreprise_1C91CEF1D587E30" type="text" name="nom d'entreprise" value="Tapez votre nom d'entreprise" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Date_1C91CEF2036E600"><font color="#cc00cc"><strong>Date(date fixé pour la fin du projet)</strong></font></label></td>
<td width="242" height="26"><input id="ID_Date_1C91CEF2036E600" type="text" name="Date" value="Date pour la fin du projet" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Adresse postale_1C91CEF247D1B30"><strong><font color="#cc00cc">Adresse postale</font></strong></label></td>
<td width="242" height="26"><input id="ID_Adresse postale_1C91CEF247D1B30" type="text" name="Adresse postale" value="Tapez l'adresse de l'entreprise" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_code postal_1C91CEF27603DF0"><strong><font color="#cc00cc">Code Postal</font></strong></label></td>
<td width="242" height="26"><input id="ID_code postal_1C91CEF27603DF0" type="text" name="code postal" value="Tapez le code postal" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_code postal_1C91CEF27603DF0"><font color="#cc00cc"><strong>Ville</strong></font></label></td>
<td width="242" height="26"><input id="ID_code postal_1C91CEF27603DF0" type="text" name="Ville" value="Tapez la ville" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_ville_1C91CEF2BD17AC0"><font color="#cc00cc"><strong>Province</strong></font></label></td>
<td width="242" height="26"><input id="ID_ville_1C91CEF2BD17AC0" type="text" name="Province" value="Québec" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_E-mail_1C91CEF30B2DE80"><font color="#cc00cc"><strong>Adresse e-mail</strong></font></label></td>
<td width="242" height="26"><input id="ID_E-mail_1C91CEF30B2DE80" type="text" name="E-mail" value="Adresse e-mail(entrepsire)" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Téléphone 1_1C91CEF33284B50"><strong><font color="#cc00cc">Téléphone de l'entreprise</font></strong></label></td>
<td width="242" height="26"><input id="ID_Téléphone 1_1C91CEF33284B50" type="text" name="Téléphone 1" value="444-444-4444" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Téléphone autre_1C91CEF3652D750"><strong><font color="#cc00cc">Téléphone (autre)</font></strong></label></td>
<td width="242" height="26"><input id="ID_Téléphone autre_1C91CEF3652D750" type="text" name="Téléphone autre" value="444-444-4444" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="30">
<td align="left" valign="middle" height="30">
<div align="center"></div>
</td>
<td width="242" height="30">
<div align="left">
<input type="submit" name="Envoyer" value="Envoyer"/></div>if($ok){<?php
if(mail("jessik_j7@sympatico.ca","Message de la page contact du site ","Fonction mail() OK") == true)
{ echo "Votre message nous est bien parvenu"; }
// envoi du resultat par email
$sujet= "Formulaire du site ".$referer;
$body.="Page d'origine : Page contact du site";
$body.="\n*** Demande du site ***\n";
if(count($HTTP_POST_VARS)){
while (list($key, $val) = each($HTTP_POST_VARS)){
$body.="$key : $val\n";
}
}
if(count($HTTP_GET_VARS)){
while (list($key, $val) = each($HTTP_GET_VARS)){
$body.="$key : $val\n";
}
}
$body.="*************************\n";
if(!email("jessik_j7@sympatico.ca",$dest,$sujet,$body)){
print "erreur envoi email <br>";
}
// affiche le html qui suit si succes
?>
</td>
<td width="70" height="30"></td>
<td width="95" height="30"></td>
</tr>
</table>
J'ai un problème avec mon formulaire et je veux m'arracher les cheveux. Est-ce que quelqu'un peu m'aider??
Le seule problème que j'ai, c'est d'être capable de récupérer les données. Je suis novice dans la programmation, donc voici le code de mon formulaire:
<table width="704" border="3" cellspacing="2" cellpadding="0" align="center">
<tr height="23">
<td height="23"><input id="ID_checkboxName_1C91CFC18A89ED0" type="checkbox" name="Site internet complet" value="Site internet complet" /><label for="ID_checkboxName_1C91CFC18A89ED0"><font color="#cc00cc"><strong>Site Web (complet)</strong></font>l</label></td>
<td width="242" height="23"><input id="ID_checkboxName_1C91CFC1D8C4C80" type="checkbox" name="site web graphisme seulement" value="site web graphisme seulement" /><label for="ID_checkboxName_1C91CFC1D8C4C80"><font color="#cc00cc"><strong>Site Web (graphisme seulement)</strong></font>l</label></td>
<td width="70" height="23"></td>
<td width="95" height="23"></td>
</tr>
<tr height="18">
<td height="18"><input id="ID_checkboxName_1C91CFCFCED0D60" type="checkbox" name="Pub courriel" value="Pub courriel" /><label for="ID_checkboxName_1C91CFCFCED0D60"><font color="#cc00cc"><strong>Pub courriel</strong></font></label></td>
<td width="242" height="18"><input id="ID_checkboxName_1C91CFDCF69500" type="checkbox" name="concept logo" value="concept logo" /><label for="ID_checkboxName_1C91CFDCF69500"><font color="#cc00cc"><strong>Concept logo</strong></font></label></td>
<td width="70" height="18"></td>
<td width="95" height="18"></td>
</tr>
<tr height="18">
<td height="18"><input id="ID_checkboxName_1C91CFD103A710" type="checkbox" name="Bannière" value="Bannière" /><label for="ID_checkboxName_1C91CFD103A710"><font color="#cc00cc"><strong>Bannière de pub internet</strong></font>l</label></td>
<td width="242" height="18"><input id="ID_checkboxName_1C91CFD12DBAD20" type="checkbox" name="Cartes d'affaires" value="Cartes d'affaires" /><label for="ID_checkboxName_1C91CFD12DBAD20"><font color="#cc00cc"><strong>Cartes d'affaires</strong></font></label></td>
<td width="70" height="18"></td>
<td width="95" height="18"></td>
</tr>
<tr height="18">
<td height="18"><input id="ID_checkboxName_1C91CFD390E1A0" type="checkbox" name="imprimé" value="imprimé" /><label for="ID_checkboxName_1C91CFD390E1A0"><font color="#cc00cc"><strong>Imprimé</strong></font></label></td>
<td width="242" height="18"><input id="ID_checkboxName_1C91CFD1593EF50" type="checkbox" name="Affiche" value="Affiche" /><label for="ID_checkboxName_1C91CFD1593EF50"><font color="#cc00cc"><strong>Affiche, banderole, etc.</strong></font>l</label></td>
<td width="70" height="18"></td>
<td width="95" height="18"></td>
</tr>
<tr height="19">
<td height="19"></td>
<td width="242" height="19"><label for="ID_textfieldName_1C91CFD18AB6880"><input type="checkbox" name="Autres" value="Autres" /><font color="#cc00cc"><strong>Autres</strong></font></label><input id="ID_textfieldName_1C91CFD18AB6880" type="text" name="Autres" value="Autres" size="24" maxlength="50" /></td>
<td width="70" height="19"></td>
<td width="95" height="19"></td>
</tr>
<tr height="37">
<td height="37"><label for="ID_type de payment_1C91CF3E3A9240"><font color="#cc00cc"><strong>Mode de payment</strong></font></label></td>
<td width="242" height="37"><input id="ID_type de payment_1C91CF3E3A9240" type="radio" name="type de payment" value="Virement" checked="checked" /><strong><font color="#cc00cc">Virement bancaire</font></strong></td>
<td width="70" height="37"><font color="#cc00cc"><input id="ID_type de payment_1C91CF3CA09150" type="radio" name="type de payment" value="Paypal" /><strong>Paypal</strong></font></td>
<td width="95" height="37"><font color="#cc00cc"><strong><input type="radio" name="type de payment" value="autres" /> Autres</strong></font></td>
</tr>
<tr height="26">
<td height="26"><strong><label for="ID_nom_1C91CEED258A9F0"><font color="#cc00cc"><strong>Nom</strong></font></label></strong></td>
<td width="242" height="26"><input id="ID_nom_1C91CEED258A9F0" type="text" name="nom" value="Tapez votre nom ici" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Prénom_1C91CEF1684E760"><strong><font color="#cc00cc">Prénom</font></strong></label></td>
<td width="242" height="26"><input id="ID_Prénom_1C91CEF1684E760" type="text" name="Prénom" value="Tapez votre prénom ici" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_nom d'entreprise_1C91CEF1D587E30"><font color="#cc00cc"><strong>Nom de l'entreprise(numéro s'il y a lieu)</strong></font></label></td>
<td width="242" height="26"><input id="ID_nom d'entreprise_1C91CEF1D587E30" type="text" name="nom d'entreprise" value="Tapez votre nom d'entreprise" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Date_1C91CEF2036E600"><font color="#cc00cc"><strong>Date(date fixé pour la fin du projet)</strong></font></label></td>
<td width="242" height="26"><input id="ID_Date_1C91CEF2036E600" type="text" name="Date" value="Date pour la fin du projet" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Adresse postale_1C91CEF247D1B30"><strong><font color="#cc00cc">Adresse postale</font></strong></label></td>
<td width="242" height="26"><input id="ID_Adresse postale_1C91CEF247D1B30" type="text" name="Adresse postale" value="Tapez l'adresse de l'entreprise" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_code postal_1C91CEF27603DF0"><strong><font color="#cc00cc">Code Postal</font></strong></label></td>
<td width="242" height="26"><input id="ID_code postal_1C91CEF27603DF0" type="text" name="code postal" value="Tapez le code postal" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_code postal_1C91CEF27603DF0"><font color="#cc00cc"><strong>Ville</strong></font></label></td>
<td width="242" height="26"><input id="ID_code postal_1C91CEF27603DF0" type="text" name="Ville" value="Tapez la ville" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_ville_1C91CEF2BD17AC0"><font color="#cc00cc"><strong>Province</strong></font></label></td>
<td width="242" height="26"><input id="ID_ville_1C91CEF2BD17AC0" type="text" name="Province" value="Québec" size="25" maxlength="70" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_E-mail_1C91CEF30B2DE80"><font color="#cc00cc"><strong>Adresse e-mail</strong></font></label></td>
<td width="242" height="26"><input id="ID_E-mail_1C91CEF30B2DE80" type="text" name="E-mail" value="Adresse e-mail(entrepsire)" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Téléphone 1_1C91CEF33284B50"><strong><font color="#cc00cc">Téléphone de l'entreprise</font></strong></label></td>
<td width="242" height="26"><input id="ID_Téléphone 1_1C91CEF33284B50" type="text" name="Téléphone 1" value="444-444-4444" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="26">
<td height="26"><label for="ID_Téléphone autre_1C91CEF3652D750"><strong><font color="#cc00cc">Téléphone (autre)</font></strong></label></td>
<td width="242" height="26"><input id="ID_Téléphone autre_1C91CEF3652D750" type="text" name="Téléphone autre" value="444-444-4444" size="25" maxlength="40" /></td>
<td width="70" height="26"></td>
<td width="95" height="26"></td>
</tr>
<tr height="30">
<td align="left" valign="middle" height="30">
<div align="center"></div>
</td>
<td width="242" height="30">
<div align="left">
<input type="submit" name="Envoyer" value="Envoyer"/></div>if($ok){<?php
if(mail("jessik_j7@sympatico.ca","Message de la page contact du site ","Fonction mail() OK") == true)
{ echo "Votre message nous est bien parvenu"; }
// envoi du resultat par email
$sujet= "Formulaire du site ".$referer;
$body.="Page d'origine : Page contact du site";
$body.="\n*** Demande du site ***\n";
if(count($HTTP_POST_VARS)){
while (list($key, $val) = each($HTTP_POST_VARS)){
$body.="$key : $val\n";
}
}
if(count($HTTP_GET_VARS)){
while (list($key, $val) = each($HTTP_GET_VARS)){
$body.="$key : $val\n";
}
}
$body.="*************************\n";
if(!email("jessik_j7@sympatico.ca",$dest,$sujet,$body)){
print "erreur envoi email <br>";
}
// affiche le html qui suit si succes
?>
</td>
<td width="70" height="30"></td>
<td width="95" height="30"></td>
</tr>
</table>
A voir également:
- Formulaire, récupérer les données
- Whatsapp formulaire opposition - Guide
- Fuite données maif - Guide
- Comment récupérer les messages supprimés sur whatsapp - Guide
- Formulaire de réclamation facebook compte désactivé - Guide
- Supprimer les données de navigation - Guide
8 réponses
Salut,
En fait il te manque la balise form et la méthode Post pour pouvoir envoyer les données et les récupérer.
Ajoute avant ton code ceci :
<form name="formu" action="page_qui_reçoit_les_donnees.php" method="post">
Ajoute ceci à la fin de ton formulaire. le bouton d'envoi doit être compris dans ton formulaire
</form>
Enfin dans ton script PHP, les données postées seront accessibles comme ceci :
$donnee = $_POST['nom de mon champ']
Bon courage.
IC
En fait il te manque la balise form et la méthode Post pour pouvoir envoyer les données et les récupérer.
Ajoute avant ton code ceci :
<form name="formu" action="page_qui_reçoit_les_donnees.php" method="post">
Ajoute ceci à la fin de ton formulaire. le bouton d'envoi doit être compris dans ton formulaire
</form>
Enfin dans ton script PHP, les données postées seront accessibles comme ceci :
$donnee = $_POST['nom de mon champ']
Bon courage.
IC
J'ai essayé et cela m'ouvre une autre page qu'internet ne peut trouver.
Qu'est-ce que j'ai fait de pas correct, ça marche pas mon affaires.
Je pense que c'est comment les donnés sont accessible que je n'ai pas compris.
Excuse moi, je ne suis pas trop bonne encore!!!
Dans le font, je veux recevoir le formulaire dans ma boite de messagerie personnel, est-ce possible???
Qu'est-ce que j'ai fait de pas correct, ça marche pas mon affaires.
Je pense que c'est comment les donnés sont accessible que je n'ai pas compris.
Excuse moi, je ne suis pas trop bonne encore!!!
Dans le font, je veux recevoir le formulaire dans ma boite de messagerie personnel, est-ce possible???
Oui c possible, mais il faut qu'un script php crée le mail avec les données et te l'envoie
En fait dans ta page HTML, il te faut un <form> avec une methode POST
<form method="post" action="page.php">
<input name="c1">
<input name="c2">
<input type="submit" name="envoi">
</form>
Lorsque tu cliques sur le bouton submit, les données contenues dans les champs c1 et c2 sont transmises à "page.php" (celle qui est indiquée dans action) pour être traitées. Cette page doit forcément être un PHP ou ASP ou tout autre langage de script. Tu peux aussi rappeler la page en cours (celle qui contient le formulaire) si celle ci contient une section écrite en php et comportant les instructions de traitement.
Dans les 2 cas, la page PHP reçoit les données dans le tableau $_POST. Chaque champ est référencé par son nom et contient la valeur qui lui est associée dans le formulaire. Ainsi tu aurais $_POST['c1'] pour le champ c1.
Si tu veux envoyer les données par mail, il faut récupérer les données dans le tableaU $_POST, les assembler sous la forme d'une chaine et utiliser la fonction mail de php pour créer un mail.
J'espère que cela t'aidera.
A+
IC
En fait dans ta page HTML, il te faut un <form> avec une methode POST
<form method="post" action="page.php">
<input name="c1">
<input name="c2">
<input type="submit" name="envoi">
</form>
Lorsque tu cliques sur le bouton submit, les données contenues dans les champs c1 et c2 sont transmises à "page.php" (celle qui est indiquée dans action) pour être traitées. Cette page doit forcément être un PHP ou ASP ou tout autre langage de script. Tu peux aussi rappeler la page en cours (celle qui contient le formulaire) si celle ci contient une section écrite en php et comportant les instructions de traitement.
Dans les 2 cas, la page PHP reçoit les données dans le tableau $_POST. Chaque champ est référencé par son nom et contient la valeur qui lui est associée dans le formulaire. Ainsi tu aurais $_POST['c1'] pour le champ c1.
Si tu veux envoyer les données par mail, il faut récupérer les données dans le tableaU $_POST, les assembler sous la forme d'une chaine et utiliser la fonction mail de php pour créer un mail.
J'espère que cela t'aidera.
A+
IC
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question