Précédent   Forum des professionnels en informatique > PHP > Scripts
Scripts Forum d'entraide sur les scripts PHP téléchargés. Les meilleurs scripts PHP, la FAQ scripts PHP, toutes les FAQ PHP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 21/11/2011, 12h19   #1
Invité de passage
 
Homme
Inscription : novembre 2011
Messages : 6
Détails du profil
Informations personnelles :
Sexe : Homme

Informations professionnelles :
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : novembre 2011
Messages : 6
Points : 1
Points : 1
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 :
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 :
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
Type de fichier : php creerclient.php (2,5 Ko, 4 affichages)
Type de fichier : php creerclient_trait.php (511 octets, 0 affichages)
chidap est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/11/2011, 12h03   #2
Membre régulier
 
franck franck
Développeur Web
Inscription : mai 2010
Messages : 98
Détails du profil
Informations personnelles :
Nom : franck franck
Localisation : France

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : mai 2010
Messages : 98
Points : 91
Points : 91
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.
franck31 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 10h49.


 
 
 
 
Partenaires

Hébergement Web