Probleme PHP enregistrement des données saisi
sephirothmana
Messages postés
16
Date d'inscription
Statut
Membre
Dernière intervention
-
P@ Messages postés 1709 Date d'inscription Statut Membre Dernière intervention -
P@ Messages postés 1709 Date d'inscription Statut Membre Dernière intervention -
Bonjour je suis de retour pour une nouvelle question
Mon formulaire fonctionne mais je ne sais pas comment enregistrer les valeurs saisies dans ma base de données
Si kk& pouvai m'aider ce serait gentil merci la table ou les données seront enregistrer s'apelle publi_publicationstempo
Voila le code de mon formulaire
Merci de bien vouloir m'aider je debute et c tres dur
Mon formulaire fonctionne mais je ne sais pas comment enregistrer les valeurs saisies dans ma base de données
Si kk& pouvai m'aider ce serait gentil merci la table ou les données seront enregistrer s'apelle publi_publicationstempo
Voila le code de mon formulaire
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <form action="ConfirmationSaisie.php" method="POST"> <head> <title>Fomulaire de saisie des publications</title> </head> <style type="text/css"> <!-- .auteur {width:150px;} --> </style> <body> <?php define("SERVEUR","localhost"); define("LOGIN","root"); define("MDP",""); define("MABASE","dbleom"); //connexion au serveur de BD MySql $connexion=mysql_connect(SERVEUR,LOGIN,MDP); //connexion a la base de donnée mysql_select_db(MABASE,$connexion); // execution des requetes $i=1; $j=1; $req1 = "SELECT publi_equipelibelle FROM publi_equipe"; $req22 = "SELECT publi_revuenom FROM publi_revue"; $query1 = mysql_query($req1); $query22 = mysql_query($req22); ?> <small><big><big><span style="font-weight: bold;"><br> </span></big></big></small> <table style="text-align: left; width: 957px; height: 33px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td>Légende :<br> <span style="font-weight: bold;">Champs obligatoires :</span> <img style="width: 44px; height: 18px;" alt="obligatoire" src="image/fleche_rouge.gif"> <span style="font-style: italic;">Champs facultatifs</span></td> </tr> </tbody> </table> <big><big><span style="font-weight: bold;"><small> </small></span><span style="font-weight: bold;"><small> </small></span></big></big><br> <small><img style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"> </small><big><big><span style="font-weight: bold;"><small>Code unité </small></span></big></big><big><big><span style="font-weight: bold;"><small><textarea readonly="readonly" cols="6" rows="1" name="codeuni"></textarea></small></span></big></big> <big><big><span style="font-weight: bold;"><small> </small></span><small><span style="font-style: italic;">Code équipe : </span></small><span style="font-weight: bold;"><small> <select name="choixequipe"> <?php while($val=mysql_fetch_array($query1)) { echo "<option>".$val["publi_equipelibelle"]. "</option>n"; } ?> </select> </small></span></big></big><br> <br> <input value="Ajouter" name="ajouter" type="button"><br> <small><img style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"> <big><big><big><span style="font-weight: bold;"><small>Type principal : </small></span><small><span style="font-style: italic;">Type Secondaire:<br> <br> Type libre : </span></small></big></big></big></small><small><big><big><big><small><span style="font-style: italic;"><textarea cols="10" rows="1" name="TypeLibre"></textarea></span></small></big></big></big></small><small><big><big><big><small><span style="font-style: italic;"> Identifiant dans la base d'origine: <textarea cols="9" rows="1" name="IDDB"></textarea><br> <br> </span></small></big></big></big></small><small><img style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"></small><small><big><big><big><small><span style="font-style: italic;"> </span><span style="font-weight: bold;">Statut :</span><span style="font-style: italic;"> </span></small></big></big></big></small> <select size="1" name="Statut"> <option>non publié (NPU)</option> <option>publié (PUB)</option> <option>à paraitre (APA)</option> </select> <small><big><big><big><small><span style="font-style: italic;"> </span></small></big></big></big></small> <br> <br> <span style="font-style: italic;">Affiliation : <textarea cols="10" rows="1" name="Affiliation"></textarea> <br> <br> </span><small> <img title="obligatoire" style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"> <big><big><span style="font-weight: bold;">Liste formatée d'auteurs : (Capacité de 20 auteurs)</span></big></big></small><big><big><span style="font-weight: bold;"></span><big><big><span style="font-weight: bold;"></span></big></big></big></big> <table style="text-align: left; width: 1003px; height: 152px;" border="1" cellpadding="2" cellspacing="2"> <caption style="caption-side: bottom;"></caption><tbody> <tr> <td style="white-space: nowrap;"> 1er auteur 2e auteur 3e auteur 4e auteur 5e auteur 6e auteur 7e auteur 8e auteur 9e auteur 10e auteur 11e auteur 12e auteur 13e auteur 14e auteur 15e auteur 16e auteur 17e auteur 18e auteur 19e auteur 20e auteur<br> Nom : <?php while($i<=20) { $req2 = "SELECT publi_auteurnom FROM publi_auteur"; $query2 = mysql_query($req2); $req3 = "SELECT publi_auteurinitial FROM publi_auteur"; $query3 = mysql_query($req3); echo"<select name='auteur.$i' class='auteur'>"; if ($i==1) { echo"<option select>Saisie obligatoire</option>"; } else { echo"<option select></option>"; } while(($val=mysql_fetch_array($query2)) and ($val2 = mysql_fetch_array($query3))) { echo "<option>".$val["publi_auteurnom"].".".$val2["publi_auteurinitial"]. "</option>n"; } echo"</select>"; $i++; } ?> <br> </td> </tr> </tbody> </table> <small><big><br> <br> <big><span style="font-weight: bold;"></span></big></big></small><small><img style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"></small><small><big><big><span style="font-weight: bold;">Titre : <textarea cols="70" rows="1" name="Titre"></textarea><br> <br> <br> </span></big></big></small><small><img style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"> <big><big><span style="font-weight: bold;">Année de publication : <textarea cols="6" rows="1" name="Anpubli"></textarea></span></big></big></small><small><big><big><span style="font-weight: bold;"><br> <br> <br> </span></big></big></small> <table style="text-align: left; width: 422px; height: 152px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="white-space: nowrap;"><big><big><span style="font-style: italic;"><small><span style="font-style: italic;"><big><span style="font-style: italic;"><span style="font-style: italic;"><small>Section / sous section :</small></span></span></big></span></small></span></big></big> (3 couples maxi)<br> º <textarea cols="15" rows="1" name="section1"></textarea> / <textarea cols="15" rows="1" name="soussection1"></textarea><br> º <textarea cols="15" rows="1" name="section2"></textarea> / <textarea cols="15" rows="1" name="soussection2"></textarea><br> º <textarea cols="15" rows="1" name="section3"></textarea> / <textarea cols="15" rows="1" name="soussection3"></textarea></td> </tr> </tbody> </table> <small><big><big><span style="font-weight: bold;"><br> </span></big><big style="font-style: italic;"><big><span style="font-weight: bold;"></span></big></big></big></small> <table style="text-align: left; width: 326px; height: 93px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td nowrap="nowrap"><big style="font-style: italic;">Choix langue</big><br> <input name="langue1" value="" type="radio"> <img style="width: 45px; height: 30px;" alt="Anglais" src="image/uk_dp.gif"> <input name="langue2" value="" type="radio"> <img style="width: 50px; height: 31px;" alt="Espagnol" src="image/Espagne.jpg"> <input name="langue3" value="" type="radio"> <img style="width: 49px; height: 32px;" alt="Italien" src="image/it_dp.gif"><br> <input name="langue4" value="" type="radio"> <img style="width: 50px; height: 32px;" alt="Français" src="image/france_dp.gif"> <input name="langue5" value="" type="radio"> <img style="width: 49px; height: 32px;" alt="Allemand" src="image/allemagne_dp.gif"> </td> </tr> </tbody> </table> <small><small><big><big><span style="font-weight: bold;"><br> </span></big></big></small><big><big><small><span style="font-style: italic;"><big><span style="font-style: italic;"><span style="font-style: italic;">Classification libre<small><small><small> <big>: </big></small></small></small></span></span></big></span></small><span style="font-weight: bold;"><textarea cols="15" rows="1" name="classifcationlibre"></textarea> </span><span style="font-style: italic;">URL d'accès au document :</span><span style="font-weight: bold;"> <textarea cols="15" rows="1" name="URL"></textarea> <br> </span><span style="font-style: italic;"> Contrat / programme associé : </span></big></big></small><small><big><big><span style="font-style: italic;"><textarea cols="15" rows="1" name="contrat"></textarea></span></big></big></small><small><big><big><span style="font-style: italic;"><br> <span style="font-style: italic;"> <img style="width: 46px; height: 20px;" alt="obligatoire" src="image/fleche_rouge.gif"> Collation formatée : </span></span></big></big></small><small><big><big><span style="font-style: italic;"><span style="font-style: italic;"><textarea cols="7" rows="1" name="colform"></textarea></span></span></big></big></small><small><big><big><span style="font-style: italic;"><span style="font-style: italic;"> </span></span></big></big></small><small><big><big><span style="font-style: italic;"><span style="font-style: italic;"></span></span></big></big></small><small><big><big><span style="font-style: italic;"><span style="font-style: italic;"><input value="aide" name="collation" type="button"> Z</span></span></big></big></small><isindex prompt=""><small><big><big><span style="font-style: italic;"><span style="font-style: italic;">one complément libre : </span></span></big></big></small><small><big><big><span style="font-style: italic;"><span style="font-style: italic;"><textarea cols="15" rows="1" name="zonecomplibre"></textarea></span></span></big></big></small><small><big><big><span style="font-style: italic;"><span style="font-style: italic;"> <br> </span><br> <br> </span></big></big></small><small><big><big><span style="font-style: italic;"></span></big></big></small><br> <table style="text-align: left; width: 768px; height: 72px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td nowrap="nowrap">Champs spécifiques aux articles de revues<br> <br> <small><img style="width: 44px; height: 19px;" alt="obligatoire" src="image/fleche_rouge.gif"> <big style="font-weight: bold;"><big>Titre revue </big></big></small><small><big style="font-weight: bold;"><big> <select name="choixrevue"> <?php while($val=mysql_fetch_array($query22)) { echo "<option>".$val["publi_revuenom"]. "</option>"; } ?> </select> </big></big></small><small><big style="font-weight: bold;"><big> </big></big><input value="Nouvelle revue" name="nouvelle revue" type="submit"><br> </td> </tr> </tbody> </table> <br> <table align="center" border="5" cellpadding="0" cellspacing="0"> <tbody> <tr> <td> <input value='Valider la saisie' type='submit'> </td> </tr> </tbody> </table> <br> ?> <small><big><big><span style="font-style: italic;"></span></big></big></small> </body> </form> </html>
Merci de bien vouloir m'aider je debute et c tres dur
A voir également:
- Probleme PHP enregistrement des données saisi
- Fuite données maif - Guide
- Trier des données excel - Guide
- Enregistrement mp3 gratuit - Télécharger - Streaming audio
- Easy php - Télécharger - Divers Web & Internet
- Sauvegarde des données - Guide
3 réponses
bon, tu peux y mettre un script pour contrôler la cohérences des données reçue dans un premier temps.
ensuite ...
tu fait une requête du type
a adapter biensur :D
au fait tu es sur une base mysql ??
ensuite ...
tu fait une requête du type
$marequete = mysql_query("INSERT INTO publi_publicationstempo (tu liste le nom de tes champ) VALUES '".$valeur1."', '".$valeur2."', '".$ect."' ");
a adapter biensur :D
au fait tu es sur une base mysql ??