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

Langage PHP Discussion :

Message de contact tout vide


Sujet :

Langage PHP

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 10
    Points : 4
    Points
    4
    Par défaut Message de contact tout vide
    Bonjour, je n’arrive pas à trouver l’erreur qui fait que je reçois des mails tout vide ?
    Est-ce que c’est Google qui me visite ou autre mais j’aimerais ne plus les recevoir
    Merci de m’aider a corrigé cela,Bien Cordialement Bernard
    CODE FORMULAIRE DE CONTACT.txtCODE POUR VERIFFORM JS.txtLE CODE POUR ENVOI.txt
    Voici les codes des 3 fichiers

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    merci de copier-coller les codes directement dans le contenu du message.
    + utiliser les balises [CODE][/CODE] -> icône # du menu.

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 10
    Points : 4
    Points
    4
    Par défaut grimbd... mes codes a revoir
    voici les code du formulaire de contact a revoir :

    Code HTML : 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
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    <html>
    <head>
    <title>Formulaire GLACE SORBET BIO</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    <!--
    .Style4 {
            font-size: 18px;
            color: #F00;
            font-weight: bold;
    }
    .Style8 {
            color: #FFF;
            font-family: "Times New Roman", Times, serif;
            font-weight: bold;
    }
    .Style12 {
            font-size: 18px;
            font-family: Arial, Modern;
            color: #FF0000;
    }
    .Style13 {
            color: #00FF00;
            font-size: 24px;
    }
    .Style14 {color: #FFFFFF}
    .Style15 {
            color: #FF0
    }
    .Style17 {font-size: medium; color: #FFFF00; }
    .Style18 {color: #FFFF00; font-family: "Times New Roman", Times, serif; }
    .Style19 {font-size: medium}
    .Style20 {
            color: #FF0000;
            font-size: 24px;
            font-family: Arial, Modern;
    }
    .Style22 {color: #FFFFFF; font-size: 36px; }
    .Style23 {
            color: #FF0000;
            font-weight: bold;
    }
    .Style25 {color: #FFFFFF; font-weight: bold; }
    body {
            background-color: #999;
            text-align: center;
    }
    .Style26 {
            color: blue;
            font-weight: bold;
    }
    .Style27 {
            font-size: medium;
            color: blue;
    }
    #Tableau_01 tr td {
            text-align: center;
    }
    #Tableau_01 tr td #Tableau_01 tr td form table tr td label strong .Style15 {
            text-align: left;
    }
    LOI {
            text-align: left;
    }
    #Tableau_01 tr td #Tableau_01 tr td form table tr td label strong .Style15 {
            text-align: left;
    }
    #iii {
            color: #F00;
    }
    #i {
            color: #F00;
    }
    -->
    </style>
    </head>
    <body bgcolor="#3c3f44" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- ImageReady Slices (log-euro.psd) -->
    <script type="text/javascript" src="flashobject.js"></script>
    <table width="1008" border="0" bgcolor="#3c3f44" align="center" cellpadding="0" cellspacing="0" id="Tableau_01">
    	<tr>
    		<td width="1008"><script type="text/javascript">
                            // <![CDATA[
                            var fo = new FlashObject("images/banni.swf", "movie", "800", "130", "7", "#FFFFFF", false, "high", "", "detect/noflash.htm");
                            fo.addVariable("langue", 1);
                            fo.addVariable("type", 1);
                            fo.addParam("quality", "height");
                            fo.addParam("wmode", "transparent");
                            fo.write("flashcontent1");
                            // ]]>
                    </script></td>
    	</tr>
    	<tr>
     
    	</tr>
    	<tr>
    		<td><div id="flashcontent2" >
    		  <div align="center" class="Style13"></div>
    		</div>
    		  <div align="center" class="Style13">
    		    <script type="text/javascript">
                            // <![CDATA[
                            var fo = new FlashObject("images/menulog.swf", "movie", "800", "42", "7", "#FFFFFF", false, "high", "", "detect/noflash.htm");
                            fo.addVariable("langue", 1);
                            fo.addVariable("type", 1);
                            fo.addParam("quality", "height");
                            fo.addParam("wmode", "transparent");
                            fo.write("flashcontent2");
                            // ]]>
                      </script>
    		    </div></td>
    	</tr>
    	<tr>
     
    	</tr>
    	<tr>
    		<td style="background-image:url(images/log-euro_bg.jpg); background-repeat:repeat-y; vertical-align:top">
    		<table width="100%" height="481" border="0" cellpadding="0" cellspacing="0" id="Tableau_01">
    			<tr>
    			  <td bgcolor="#999999" style="background-image:url(images/log-euro_bbg.gif); background-position:top; background-repeat:no-repeat; vertical-align:top; padding-left:40; padding-right:40; text-align: center; color: #FF0; font-size: 18px;">
    			   <p align="center"><span class="Style4"><span class="Style13">FORMULAIRE de CONTACT</span></span><img src="DOSSIER PHOTOS BIO/PETIT LOGO CORNET BIO.png" width="62" height="90"></p>
    			   <p>Demande de renseignements</p>
    <p align="center">&nbsp;</p>
    <form name="form" method="post" action="envoi.php" onSubmit="return(CheckForm());">
    <table width="710" align="center">  
    			  <tr>
    				<td width="248" height="64" align="right"> <p align="left" class="Style8"><strong><span class="Style14"><span class="Style15">* </span>Votre NOM</span></strong></p></td>
    				<td width="385" colspan="2"><label>
    				  <input name="nom" type="text" size="35" id="n" />
    				</label></td>
    			  </tr>
     
     
    			  <tr>
    				<td width="248" align="right"> <p align="left" class="Style8"><strong><span class="Style14"><span class="Style15">*</span>Adresse</span></strong></p></td>
    				<td width="385" colspan="2"><label>
    				  <input name="adresse" type="text" size="35" id="n" />
    				</label></td>
    			  </tr>
    			  <tr>
    				<td width="248" align="right"> <p align="left" class="Style8"><strong><span class="Style14"><span class="Style15">*</span>Ville</span></strong></p></td>
    				<td width="385" colspan="2"><label>
    				  <input name="ville" type="text" size="35" id="n" />
    				</label></td>
    			  </tr>
    			  <tr>
    				<td width="248" align="right"> <p align="left" class="Style8"><strong><span class="Style14"><span class="Style15">*</span>Code Postal</span></strong></p></td>
    				<td width="385" colspan="2"><label>
    				  <input name="postcode" type="text" size="35" id="n" onChange="verifpc(document.form.postcode.value)"/>
    				</label></td>
    			  </tr>
     
    			  <tr>
    				<td align="right"><p align="left" class="Style8"><strong><span class="Style14"><span class="Style15">*</span>Tel</span></strong></p></td>
    				<td colspan="2"><label>
    				  <input name="tel" type="text" size="35" id="t" onChange="veriftel(document.form.tel.value)"/>
    				</label></td>
    			  </tr>
    			  <tr>
    				<td align="right"><p align="left" class="Style8"><strong><span class="Style14"><span class="Style15">*</span>Mail</span></strong></p></td>
    				<td colspan="2"><label>
    				  <input name="mail" type="text" size="35" id="m" />
    				</label></td>
    			  </tr>
    			  <tr>
    				<td height="120" align="right" valign="top"><p align="left" class="Style8">&nbsp;</p>
    				  <p align="left" class="Style8"><strong><span class="Style15">*</span>Message</strong> :</p></td>
    				<td colspan="2"><label>
    				    <textarea name="message" cols="50" rows="6" id="a"></textarea>
    				    <br />
    				</label></td>
    			  </tr>
     
    <tr>
                                       <p>&nbsp;</p>
    				  <p>&nbsp;</p>
     
    			<td width="248" align="right"> <p align="right" class="Style13"><strong><span class="Style15">*Verify Code </span><span class="Style14"><span class="Style15">*</span></span></strong></p>
    			  <p align="right" class="Style13"><span id="i"><strong><em>Je ne suis pas</em>&nbsp;un&nbsp;<em>robot</em>&nbsp;!</strong></span><strong> </strong></p>
    			  <p align="right" class="Style13"><strong><span class="Style15"> </span><span class="Style14"><span class="Style15">*</span></span><span class="Style14"><img src="CALCUL.jpg" width="146" height="37"></span></strong></p></td>
    				<td width="38" height="100" colspan="1"><label>
    	              <span style="text-align: left"><strong><span class="Style15"><br>
    	              <br>
    	              <br>
    	              <br>
    	              <br>
    	              </span></strong>
    	<input class="Style27" name="resultat" type="text" size="5"maxlength="1" onChange="verif2(document.form.resultat)" id="n"/>
    				  </span></label></td>
    			  </tr>
    			  <tr>
    			    <td height="26" colspan="3" align="center"><input class="Style26" name="en" type="submit"  value="Envoyer" />
                      <input class="Style26" type="reset" name="Submit2" value="Annuler"  /></td>
    			    </tr>
    			</table>
    	        <p><span class="Style19">* Champs &agrave; renseigner obligatoirement.</span></p>
                <p align="center">              Les donn&eacute;es recueillies par ce formulaire ne seront pas   c&eacute;d&eacute;es &agrave; des tiers.</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    	        <p align="center" class="Style20">&nbsp;</p>
    			   </form>  
    			  <p align="center">&nbsp;</p>
    			  <br /><br /><p align="center"><a href="index.html"></a></p>
    		      </td>
    			</tr>
    		</table>
    		</td>
    	</tr>
    	<tr>
    		<td>&nbsp;</td>
    	</tr>
    	<tr>
    		<td align="center">
     
    <p><br />
    			    <br />
              </p></td>
    	</tr>
    </table>
    <!-- End ImageReady Slices -->
    <script type="text/javascript" src="verifform.js"></script>
    <script>
    function CheckForm() {
                                    //var i;
                                    var bFormTested = false;
                                            if(!bFormTested) {
                                                                    MM_validateForm('nom','','RTrim','Nom du responsable','entreprise','','RTrim','Entreprise','activite','','RTrim','Activite','adresse','','RTrim','Adresse','ville','','RTrim','Ville','postcode','','RTrim','Code postal','tel','','RTrim','Tel','mail','','RisEmail','Mail','resultat','','RTrim','resultat','textarea','','RTrim','textarea','','RTrim');
     
                                                    if (document.MM_returnValue) {
                                                            bFormTested = true;
                                                            document.demoform.submit();
                                                    }
                                                    else
                                                            return false;
                                            }
                                            else {
                                                    alert("Formulaire en cours d&acute;envoi, veuillez patientez");
                                            }
                            }
     
    </script>
    </body>
    </html>

    -------------------------------------------------------------

    et puis celui de veriform js
    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
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    function verifsir() {
          var reg = /^\d+$/
          if(reg.exec(document.form.message2.value)==null) {
             alert("Seul les chiffres sont autorisés !!!")
             return(document.form.message2.value ="");
             return false
          } else return true
       };
    function veriftel() {
          var reg = /^\d+$/
          if(reg.exec(document.form.tel.value)==null) {
             alert("Seul les chiffres sont autorisés !!!")
             return(document.form.tel.value ="");
             return false
          } else return true
       };
    function verifpc() {
          var reg = /^\d+$/
          if(reg.exec(document.form.postcode.value)==null) {
             alert("Seul les chiffres sont autorisés !!!")
             return(document.form.postcode.value ="");
             return false
          } else return true
       };
    function verif2()
    {
        if (document.form.resultat.value !='7')
        { 
         alert('apprend à calculer'); 
        return(document.form.resultat.value ="");
        }
     else
            {         
    	return false;
            }
    };
    function MM_findObj(n, d) { //v4.01
      var p,i,x; 
     
      if(!d) d=document;
     
      if((p=n.indexOf("?"))>0&&parent.frames.length) {
        	d=parent.frames[n.substring(p+1)].document;
    		n=n.substring(0,p);}
     
      if(!(x=d[n])&&d.all) x=d.all[n];
     
      for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
     
      for(i=0;!x&&d.layers&&i<d.layers.length;i++)
      			x=MM_findObj(n,d.layers[i].document);
     
      if(!x && d.getElementById) x=d.getElementById(n);
      //alert(n+" "+x.value);
      return x;
    }
     
    function MM_validateForm() { // avec 4 arguments
    	var ok,i,d,p,q,nm,test,num,min,max,car,errors='',args=MM_validateForm.arguments;
    	var regEmail	= new RegExp("^[a-zA-Z0-9._-]+@[A-Za-z0-9-]{2,}([.][A-Za-z0-9-]{2,}){1,3}$","");
    	var regMailing	= new RegExp("^([a-zA-Z0-9._-]+@[A-Za-z0-9-]{2,}([.][A-Za-z0-9-]{2,}){1,3};*){1,}$","");
    	var regString   = new RegExp("^[a-zA-Z]+$","");
    	var regEntier	= new RegExp("^[0-9]+$","");
    	var regDecimal	= new RegExp("^[0-9]+[,.]?[0-9]*$","");
    	var regFloat	= new RegExp("^[0-9]+[.]?[0-9]*$",""); //ligne ajoutée pour mansour
    	var regDate		= new RegExp("^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$","i");
    	var regFileAll	= new RegExp("(^[/(/)a-z0-9_-]+[.])[A-Za-z0-9]{3,4}$","i");
    	var regFileJPG	= new RegExp("(^[/(/)a-z0-9_-]+[.])((jpg)|(jpeg))$","i");
    	var regFileMp	= new RegExp("(^[/(/)a-z0-9_-]+[.])((mp3)|(mp4))$","i"); //ligne ajoutée pour paradise
    	var regFileImg	= new RegExp("(^[/(/)a-z0-9_-]+[.])((gif)|(jpg)|(jpeg)|(png))$","i");
    	var regFileAnim	= new RegExp("(^[/(/)a-z0-9_-]+[.])((gif)|(jpg)|(jpeg)|(swf)|(png))$","i");
    	var regFileFich	= new RegExp("(^[/(/)a-z0-9_-]+[.])((gif)|(jpg)|(doc)|(pdf)|(zip)|(bmp)|(wmv)|(swf))$","i");
    	var regFileMov	= new RegExp("(^[/(/)a-z0-9_-]+[.])((gif)|(jpg)|(jpeg)|(mov)|(mpg)|(mpe)|(mpeg)|(avi)|(wmv)|(rpm)|(ra)|(rm)|(fli)|(asf)|(asx))$","i");
    	var regSuppr	= new RegExp("^(oui)$","i");
    	var regFolder	= new RegExp("^[a-z0-9_-]*$","i");
     
    	for (i=0; i<(args.length-3); i+=4) { 
      		test=args[i+2];
    		field=args[i+3];
    		val=MM_findObj(args[i]);
     
    		if (val) {	
    			nm=val.name;
    			val=val.value			
     
    			if (test.indexOf('Trim')!=-1) 
    				val = val.trim(); // fonction trim
     
    			if (val!="" || val=="null") {	 
    				if (test.indexOf('isFolder')!=-1)
    					if (!regFolder.exec(val)) errors+='- '+field+' ne doit contenir que des caractères alphanumériques (de A à Z, 0 à 9, _ ou -)\n';
     
    				if (test.indexOf('isSuppr')!=-1)
    					if (!regSuppr.exec(val)) errors+='- '+field+' doit contenir "Oui" si vous voulez supprimer l\'enregistrement, sinon cliquez sur le bouton annuler\n';
     
    				if (test.indexOf('isEmail')!=-1)
    					if (!regEmail.exec(val)) errors+='- '+field+' doit contenir une address e-mail valide Ex : nom.prenom@domaine.fr\n';
     
    				if (test.indexOf('isMailing')!=-1)
    					if (!regMailing.exec(val)) errors+='- '+field+' doit contenir une address e-mail valide Ex : nom.prenom@domaine.fr\n\nPour envoyer à plusieurs personnes, séparer les adresses par un ;\n';
     
    				if (test.indexOf('isLimitecar')!=-1) {
    					p=test.indexOf(':');
    					car=test.substring(p+1);
    		        	if (car > 0 && val.length>car) errors+='- '+field+' comporte '+val.length+' caractères et ne doit pas dépasser '+car+' caractères\n'; 
    		    	}
    				if (test.indexOf('isDate')!=-1 || test.indexOf('isADate')!=-1) {
    					ok = false;
    					if( test.indexOf('isADate')!=-1 && val=="Toujours visible")
    						ok = true;
     
    					if (!regDate.exec(val) && !ok)
    		        		 errors+='- '+field+' doit être une date au format jj/mm/yyyy\n';
    					else if (!ok) { // la date existe t-elle ?
     
    						// tab_mois[0] est janvier, [11] est decembre
    						var tab_mois = new Array(31,29,31,30,31,30,31,31,30,31,30,31);	
    						var tab_moisList = new Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
     
    						jour = parseInt(eval(val.substring(0,2)));					
    						mois = parseInt(eval(val.substring(3,5)));												
    						an = parseInt(eval(val.substring(6,10)));
     
    						// année bissextile ?
    						if ((an % 100 != 0 && an % 4 == 0) || (an % 400 == 0)) { tab_mois[1] = 29; }
    						else { tab_mois[1] = 28; }						
     
    						if(mois>12 || mois<1)
    							errors+='- '+field+' contient un mois invalide.\n';
     
    						if(jour>31 || jour<1)
    							errors+='- '+field+' contient un jour invalide.\n';
     
    						mois = mois - 1;
     
    						// on teste si la date choisie est anterieure au lundi 20 decembre 1582
    						if ((an * 10000 + mois * 100 + jour) < 15821220)
    							errors+='- '+field+' contient une date antérieure au 20 décembre 1582, hors du calendrier Grégorien. Veuillez sélectionner une date plus récente.\n';
     
    						else if (tab_mois[mois] < jour) { // on verifie si la date est coherente
    							errors+='- Il n\'y a pas ' + jour + ' jours en ' + tab_moisList[mois] + ' ' + an + ' mais ' + tab_mois[mois] + '. Veuillez choisir une autre date.\n';
    						}
    					}								
    		    	}
    				if (test.indexOf('isSelect')!=-1)
    					if	(val == "null" && test.charAt(0) == 'R') errors+='- La première option de la liste '+field+' n\'est pas une sélection valide. Choisissez une des autres options.\n';
     
    				if (test.indexOf('isEntier') != -1)
    			        if (!regEntier.exec(val)) errors+='- '+field+' ne doit contenir que des Entiers.\n';
     
    				if (test.indexOf('isString') != -1)
    			        if (!regString.exec(val)) errors+='- '+field+' ne doit contenir que des Lettres.\n';
     
    				if (test.indexOf('isEntierRange') != -1) {
    					d=test.indexOf(':');
    					p=test.indexOf('to');											
    		        	min=parseInt(test.substring(d+1,p)); max=parseInt(test.substring(p+2));
    			        if (val<min || max<val) errors+='- '+field+' doit contenir un nombre Entier compris entre '+min+' et '+max+'.\n';
    			    }
    				if (test.indexOf('isNombreMax') != -1) {			
    					d=test.indexOf('>');
    					p=test.indexOf(':');						
    	        		max=parseFloat(test.substring(d+1,p));
    			        if (val>max) errors+='- Le rapport > ou = des champs '+field+' est incorrect.\n';
    				}
    				if (test.indexOf('isDecimal') != -1)
    					if (!regDecimal.exec(val)) errors+='- '+field+' ne doit contenir que Chiffres et vigule.\n';
     
    				if (test.indexOf('isFloat') != -1)
    					if (!regFloat.exec(val)) errors+='- '+field+' ne doit contenir que Chiffres et point. Ex: 120.36\n';
     
    				if (test.indexOf('isDecimalRange') != -1) {
    					d=test.indexOf(':');
    					p=test.indexOf('to');						
    		        	min=test.substring(d+1,p); max=test.substring(p+2);						
    			        if (val<min || max<val) errors+='- '+field+' doit contenir un nombre compris entre '+min+' '+val+'  et '+max+'.\n';
    			    }
    				if (test.indexOf('isMin') != -1) {			
    					d=test.indexOf('<');
    					p=test.indexOf(':');						
    	        		min=test.substring(d+1,p);																		
    			        if (val.length<min) errors+='- '+field+' doit comporter au moins '+min+' caractères.\n';
    				}
    				// fractionne aux caractères \ ou / ou  pour ne récupérer que le nom de fichier
    				if (test.indexOf('isFileAll') != -1) {
    				   	var tab = val.split(/\\|\//);
    					var ext = val.substr(val.lastIndexOf(".") + 1); 
    					ext = ext.toLowerCase(); 			
    					if (!regFileAll.exec(tab[tab.length-1]) || ext=="exe" || ext=="com" || ext=="bat") errors+='- '+field+' contient un NOM de fichier incorrect : \"'+tab[tab.length-1]+'\" n\'est pas un fichier valide.\nLes fichiers dont l\'extention est .exe, .com ou .bat ne sont pas autorisés.\n';		
    			    }
    				if (test.indexOf('isFileMov') != -1) {					
    				   	var tab = val.split(/\\|\//);
    					if (!regFileMov.exec(tab[tab.length-1])) errors+='- '+field+' contient un NOM de fichier incorrect : \"'+tab[tab.length-1]+'\" n\'est pas un fichier Vidéo valide\n';		
    			    }
    				if (test.indexOf('isFileImg') != -1) {
    				   	var tab = val.split(/\\|\//);
    					if (!regFileImg.exec(tab[tab.length-1])) errors+='- '+field+' contient un NOM de fichier incorrect : \"'+tab[tab.length-1]+'\" n\'est pas un fichier Image valide\n';		
    			    }
    				if (test.indexOf('isFileJPG') != -1) {
    				   	var tab = val.split(/\\|\//);
    					if (!regFileJPG.exec(tab[tab.length-1])) errors+='- '+field+' ne doit contenir que des images .JPG/.JPEG\n';		
    			    }
    				if (test.indexOf('isFileMp') != -1) {//if ajouté pôur paradise
    				   	var tab = val.split(/\\|\//);
    					if (!regFileJPG.exec(tab[tab.length-1])) errors+='- '+field+' ne doit contenir que des images .JPG/.JPEG\n';		
    			    }
    			    if (test.indexOf('isFileFich') != -1) {
    				   	var tab = val.split(/\\|\//);
    					if (!regFileFich.exec(tab[tab.length-1])) errors+='- '+field+' contient un NOM de fichier incorrect : \"'+tab[tab.length-1]+'\" n\'est pas un fichier valide\n';														        
    			    }
    				if (test.indexOf('isFileAnim') != -1) {
    				   	var tab = val.split(/\\|\//);
    					if (!regFileAnim.exec(tab[tab.length-1])) errors+='- '+field+' contient un NOM de fichier incorrect : \"'+tab[tab.length-1]+'\" n\'est pas un fichier valide\n';		
    			    } 
     
    			} else if (test.charAt(0) == 'R') errors += '- '+field+' est obligatoire.\n';
    		}
    	}
    	if (errors)
    		alert('Veuillez corriger  les données suivantes :\n\n'+errors);
     
    	document.MM_returnValue = (errors == '');
    }
     
    function Compte_car(Target, maxi, nomchamp){
    	var CharsLeft = Target.value.length;
    	if (CharsLeft > maxi ){
    		Target.value = Target.value.substring(0,maxi);
    		CharsLeft = maxi;								
    	}
    	nomchamp.value = CharsLeft+' / '+maxi+' c. Maxi';	
    }
    function disableForm() {
    	if (document.all || document.getElementById) { // ns6+ ou ie4+
    		var aForm = document.forms;
    		var tempobj, tempobjtype, i, ii;
     
    		for (ii=0;ii<aForm.length;ii++) {	// tous les formulaires de la page					
    			for (i=0;i<aForm[ii].length;i++) {
    				tempobj = aForm[ii][i];				
    				if (tempobj.type != null) {
    					tempobjtype = tempobj.type.toLowerCase();
    					if (tempobjtype == "submit" || tempobjtype == "button" || tempobjtype == "reset" || tempobjtype == "image")
    						tempobj.disabled = true;
    				}
    			}
    		}
    	}
    }
     
    // Ajoute la fonction trim comme méthode de l'objet String.
    String.prototype.trim = function()
    { return this.replace(/(^\s*)|(\s*$)/g, ""); }
    ----------------------------------------------

    et puis le code pour ENVOI

    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
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    <?
     
     
    $mailTo = "grimbd@yahoo.fr";
    		$mailSubject = "Formulaire Site GLACE  BIO FR [Contacte]";
     
    		$mailBody  = "<html>";
    		$mailBody .= "<body>";
    		$mailBody .= "<table border='1' bordercolor='#2B570A' align='center' cellspacing='0' cellpadding='4' width='95%' style='border-collapse:collapse'>";
     
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td align='center' bgcolor='#F9D38D' height='18' colspan='4'><strong>Site web GLACE SORBET BIO</strong></td>";
    		$mailBody .= "</tr>";
     
     
     
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>Nom :</strong></td>";
    		$mailBody .= "	<td><label>"; if (!empty($_POST['nom'])) $mailBody .= $_POST['nom']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>Email :</strong></td>";
    		$mailBody .= "	<td><label>"; if (!empty($_POST['mail'])) $mailBody .= $_POST['mail']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "</tr>";
     
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>Adresse :</strong></td>";
    		$mailBody .= "	<td><label>"; if (!empty($_POST['adresse'])) $mailBody .= $_POST['adresse']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>Ville :</strong></td>";
    		$mailBody .= "	<td><label>"; if (!empty($_POST['ville'])) $mailBody .= $_POST['ville']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "</tr>";
     
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>Code postal :</strong></td>";
    		$mailBody .= "	<td colspan='3'><label>"; if (!empty($_POST['postcode'])) $mailBody .= $_POST['postcode']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "</tr>";
     
     
     
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>Tel :</strong></td>";
    		$mailBody .= "	<td colspan='3'><label>"; if (!empty($_POST['tel'])) $mailBody .= $_POST['tel']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "</tr>";
     
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td colspan='4' width='100' bgcolor='#F9D38D'><strong>Message :</strong></td>";
    		$mailBody .= "</tr>";
    		$mailBody .= "<tr>";
    		$mailBody .= "	<td height='60' colspan='4'><label>"; if (!empty($_POST['message'])) $mailBody .= stripslashes($_POST['message']); else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "</tr>";
     
                    $mailBody .= "<tr>";
    		$mailBody .= "	<td width='100' bgcolor='#F9D38D'><strong>resultat :</strong></td>";
    		$mailBody .= "	<td colspan='3'><label>"; if (!empty($_POST['resultat'])) $mailBody .= $_POST['resultat']; else $mailBody .= "n.c."; $mailBody .= "</label></td>";
    		$mailBody .= "</tr>";
    		$mailBody .= "</table>";
    		$mailBody .= "</body>";
    		$mailBody .= "</html>";
     
    		$headerdate = date("D, j M Y H:i:s -0600");
     
    		$mailHeaders  = "MIME-Version: 1.0\r\n";
    		$mailHeaders .= "Content-type: text/html; charset=iso-8859-1\r\n";
     
    		$mailHeaders .= "CC:\r\n";
     
    		$mailHeaders .= "Date : $headerdate\r\n";
     
    //print $mailBody."<br><br>";
    		//mail($mailTo,$mailSubject,$mailBody,$mailHeaders);
    		mail('grimbd@yahoo.fr',$mailSubject,$mailBody,$mailHeaders);
     
    ?>
    <html>
    <head>
    <title>GLACE BIO</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    .Style2 {
    	font-size: x-large;
    	color: #feb008;
    }
    .Style4 {
    	font-size: medium;
    	color: #feb008;
    }
    .Style10 {
    	color: #0000FF;
    	text-decoration:none;
    	font-size: 24px;
    }
    .Style17 {font-size: medium; color: #FFFF00; }
    .Style18 {color: #FFFF00; font-family: "Times New Roman", Times, serif; }
    HJHJK {
    	color: #00F;
    }
    #Tableau_01 tr td #Tableau_01 tr td p {
    	text-align: center;
    }
    #Tableau_01 tr td #Tableau_01 tr td div p {
    	text-align: center;
    }
     
     
    -->
    </style>
    </head>
    <body bgcolor="#3c3f44" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- ImageReady Slices (log-euro.psd) -->
    <script type="text/javascript" src="flashobject2.js"></script>
    <table width="955" border="0" bgcolor="#3c3f44" align="center" cellpadding="0" cellspacing="0" id="Tableau_01">
    	<tr>
    		<td width="955"><div id="flashcontent1" ></div>
    		<script type="text/javascript">
    			// <![CDATA[
    			var fo = new FlashObject("images/banni.swf", "movie", "800", "130", "7", "#FFFFFF", false, "high", "", "detect/noflash.htm");
    			fo.addVariable("langue", 1);
    			fo.addVariable("type", 1);
    			fo.addParam("quality", "height");
    			fo.addParam("wmode", "transparent");
    			fo.write("flashcontent1");
    			// ]]>
    		</script></td>
    	</tr>
    	<tr>
    		<td>&nbsp;</td>
    	</tr>
    	<tr>
    		<td><div id="flashcontent" ></div>
    		<script type="text/javascript">
    			// <![CDATA[
    			var fo = new FlashObject("images/menulog.swf", "movie", "800", "42", "7", "#FFFFFF", false, "high", "", "detect/noflash.htm");
    			fo.addVariable("langue", 1);
    			fo.addVariable("type", 1);
    			fo.addParam("quality", "height");
    			fo.addParam("wmode", "transparent");
    			fo.write("flashcontent");
    			// ]]>
    		</script></td>
    	</tr>
    	<tr>
    		<td>&nbsp;</td>
    	</tr>
    	<tr>
    		<td style="background-image:url(images/log-euro_bg.jpg); background-repeat:repeat-y; vertical-align:top">
    		<table width="100%" height="481" border="0" cellpadding="0" cellspacing="0" id="Tableau_01">
    			<tr>
    			  <td bgcolor="#000000" style="background-image:url(images/log-euro_bbg.gif); background-position:top; background-repeat:no-repeat; vertical-align:top; padding-left:40; padding-right:40; color: #FF0; font-size: 24px;">
    			    <div align="center">
    			      <DIV align="center">
    			        <p><BR>
    			          <BR>
    			          <BR>
    			          <BR>
    		            </p>
    		          </DIV>
                      <p align="center"><BR>
                      Merci de nous avoir contact&eacute; , nous vous r&eacute;pondrons rapidement .</p>
                      <p><a href="ACCUEIL.html"><br>
    		          RETOUR</a><br>
    			        <br>
    			        <br>
    			        <br>
    		          </p>
    </div>
    			    <p align="center"><br>
    			      <br>
    	            <span style="color: #00F"></span></p>
    			    <br>
                    <br> 
    			  <p align="center">&nbsp;</p>		      </td>
    			</tr>
    		</table>
    		</td>
    	</tr>
    	<tr>
    		<td>&nbsp;</td>
    	</tr>
    	<tr>
    		<td align="center"><br>
    			<br></td>
    	</tr>
    </table>
    <!-- End ImageReady Slices -->
    </body>
    </html>
    --------------------------------
    mon site c'est le : www.glace-bio.fr

    Merci d'avance
    Cordialement
    Bernard

  4. #4
    Invité
    Invité(e)
    Par défaut
    Houlà......... ça pique les yeux........

    Ton code date du grand-père de Mathusalem.
    A part te conseiller de TOUT ré-écrire de façon "moderne".....


    Essaie déjà :
    • d'afficher les variables pour voir ce qu'elles contiennent (echo $mailHeaders; notamment)
    • ajoute les headers nécessaires à la fonction mail() : 'from':...
    • Envoyer un mail en PHP

    ... Est-ce que c’est Google qui me visite ou autre mais j’aimerais ne plus les recevoir...
    Pas compris...

    [EDIT] Houlà (bis) Même le design du site date des années 80... (fond noir, textes flashy centrés,...) (ceci dit sans aucune méchanceté)

    Tu devrais peut-être t'intéresser à Wordpress :
    • c'est gratuit
    • il existe des thèmes sympas...
    • ...et tu auras au moins un beau site MODERNE
    Dernière modification par Invité ; 06/12/2019 à 16h29.

  5. #5
    Candidat au Club
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 10
    Points : 4
    Points
    4
    Par défaut grimbd... , désolé si ca pique
    Bonsoir
    Oui je sais mon site est pas beau, mais en attendant d’avoir mieux j’ai fait ca avec Deamweaver
    Et pour la question sur Google moi je penser que c’était les moteurs de recherche qui lorsqu’il me visite me fond des mails vide ?
    Mon problème c’est que J’ai récupérer ces codes qui marche bien quand on m’écrit ,
    mais c’est que je reçois aussi plein de mail vide et la je suis incapable de refaire tout les code pour ce mail de contact
    alors y a-t-il un morceau de code a rajouter pour ne plus recevoir de mail vide sans tout refaire ,
    merci de m’aider dans ce sens
    Cordialement Bernard

  6. #6
    Invité
    Invité(e)
    Par défaut
    Compris.

    Il suffit de tester que les données obligatoires ne soient pas vides avant l'envoi.

  7. #7
    Candidat au Club
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 10
    Points : 4
    Points
    4
    Par défaut OK ...compris
    Bonsoir
    OK pour tester que les données obligatoires ne soient pas vides avant l’envoi,
    mais moi je ne sais pas faire ce code à rajouter
    Alors si c’est possible de me le passer,
    quand vous aurez un petit moment, grand merci d’avance
    Bien cordialement
    Bernard

  8. #8
    Membre expert
    Avatar de Dendrite
    Femme Profil pro
    Développeuse informatique
    Inscrit en
    Juin 2008
    Messages
    2 129
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 58
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeuse informatique
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Juin 2008
    Messages : 2 129
    Points : 3 627
    Points
    3 627
    Billets dans le blog
    8
    Par défaut
    Partout où tu as une balise HTML <input> qui te semble obligatoire, tu ajoutes ceci : required.

    exemple :

    Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
    <input name="nom" type="text" size="35" id="n" required />
    PDO, une soupe et au lit !
    Partir de la fin est un bon moyen de retrouver son chemin. Bibi - 2020

  9. #9
    Candidat au Club
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 10
    Points : 4
    Points
    4
    Par défaut grimbd... merci beaucoup
    Bonsoir
    Super codeur
    Grand Merci
    Car cela marche bien
    Cordialement
    Bernard

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. imprimer message sur console tout sur le même ligne
    Par bruno2356 dans le forum Débuter avec Java
    Réponses: 2
    Dernier message: 31/03/2010, 03h50
  2. Message d'erreur toutes les 10 secondes
    Par muzele dans le forum Windows XP
    Réponses: 3
    Dernier message: 02/01/2009, 13h29
  3. Message si répertoire est vide
    Par palcoquoz dans le forum Scripts/Batch
    Réponses: 2
    Dernier message: 14/05/2007, 08h23

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