IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

EDI, CMS, Outils, Scripts et API PHP Discussion :

script pour afficher la date saisie dans un formulaire


Sujet :

EDI, CMS, Outils, Scripts et API PHP

  1. #1
    Membre du Club
    Homme Profil pro
    freelance
    Inscrit en
    Novembre 2011
    Messages
    81
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Congo-Kinshasa

    Informations professionnelles :
    Activité : freelance

    Informations forums :
    Inscription : Novembre 2011
    Messages : 81
    Points : 43
    Points
    43
    Par défaut script pour afficher la date saisie dans un formulaire
    bjr,
    je suis nouveau, je suis un debutant ds le dvpt web j'utilise dreamweaver-php-mysql.
    j'ai concu un simple formulaire me permettant de creer client et de les afficher après un clic.
    mais le bémol, arrive premièrement au moment de l'enregistrement je n'ai pas la liste qui s'affiche après le clic. deuxièmement c'est qui me derange encore
    le champ date d'enregistrement me renvoi un message d'erreur.

    1. creerclient.php :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    <form action="creerclient_trait.php" method="post" enctype="multipart/form-data"> <table width="43%" border="0" align="center" cellpadding="3">
      <caption class="Style1">
                  Creer client
            </caption>
                <tr>
                  <th align="left" scope="row">&nbsp;</th>
                  <td align="center">&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <th width="38%" align="left" scope="row"><span class="texte">Nom</span></th>
                  <td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
                  <td width="57%"> <span class="texte">
                    <input type="text" name="nom" id="nom" />
                  </span></td>
                  </tr>
                <tr>
                  <th width="38%" align="left" scope="row"><span class="texte">Adresses</span></th>
                  <td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
                  <td width="57%"> <span class="texte">
                    <input type="text" name="adresses" id="adresses" />
                  </span></td>
                  </tr>
                <tr>
                  <th width="38%" align="left" scope="row"><span class="texte">Telephone</span></th>
                  <td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
                  <td width="57%">   <span class="texte">
                  
                    <input type="text" name="telephone" id="telephone" />
                    </span></td>
            </tr>
                <tr>
                  <th width="38%" align="left" scope="row"><span class="texte">Email</span></th>
                  <td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
                  <td width="57%"> <span class="texte">
                  <input type="text" name="email" id="email" />
                    </span> </td>
            </tr>
                <tr>
                  <th width="38%" align="left" scope="row"><span class="texte">Date enregistrement</span></th>
                  <td width="5%" align="center" > <span class="texte"><strong>:</strong></span></td>
                  <td width="57%">&nbsp;</td>
            </tr>
                <tr>
                  <th scope="row"><span class="texte">
                    <input type="reset" name="Reset" id="button" value="Annuler" />
                    </span></th>
                  <td>&nbsp;</td>
                  <td align="center"><span class="texte">
                    <input type="submit" name="button2" id="button2" value="Enregister" />
                    </span></td>
            </tr>
          </table> </form>

    2. creerclient_trait.php:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
     <?php 
    		
    	$nom=$_POST["nom"];
    	$adresses=$_POST["adresses"];
    	$telephone=$_POST["telephone"];
    	$email=$_POST["email"];
                 $dateenregistrement=$_POST["dateenregistrement"];
      	
    	
    	$req="INSERT INTO client
    	      VALUES (NULL,'$nom','$adresses','$telephone','$email','dateenregistrement')";
    	
    	$res=mysql_query($req) or die("Erreur : ".mysql_error());
    		
    	if($res){
    	
    	echo "Insertion effectuée avec succès !";
    	
    	}
    	else {
    		
    			echo "Insertion échouée !";
    				}				
    		
    	?>
    Fichiers attachés Fichiers attachés

  2. #2
    Membre actif
    Homme Profil pro
    Développeur Full Stack
    Inscrit en
    Mai 2010
    Messages
    159
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 56
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Full Stack

    Informations forums :
    Inscription : Mai 2010
    Messages : 159
    Points : 220
    Points
    220
    Par défaut
    Pour la date d'enregistrement c'est normal, tu n'as pas d'input.

    Pour savoir ce que tu récupère dans ta page creerclient_trait.php mets un print_r($_POST) au début.

Discussions similaires

  1. Réponses: 3
    Dernier message: 16/07/2013, 00h48
  2. Afficher les données saisies dans un formulaire
    Par daydream123 dans le forum Spring
    Réponses: 0
    Dernier message: 01/07/2011, 13h15
  3. [AC-2007] requete avec la date saisie dans un formulaire
    Par guaguanco dans le forum Requêtes et SQL.
    Réponses: 2
    Dernier message: 05/07/2010, 09h48
  4. Afficher derniere date saisie dans etat
    Par lg022 dans le forum IHM
    Réponses: 4
    Dernier message: 10/03/2007, 12h43
  5. [MySQL] Script pour modifier les caracteres speciaux dans la bdd
    Par isa150183 dans le forum PHP & Base de données
    Réponses: 6
    Dernier message: 15/09/2005, 13h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo