Précédent   Forum des professionnels en informatique > PHP > Langage > Formulaires
Formulaires Forum d'entraide sur les formulaires avec PHP. Avant de poster -> FAQ formulaires, Cours de formulaires et Sources de formulaires
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 13/08/2008, 14h44   #1
Invité de passage
 
Inscription : décembre 2004
Messages : 2
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 2
Points : 0
Points : 0
Par défaut Format fenêtre et texte feedback après envoi formulaire

Bonjour,

J'avance dans mon projet de formulaire php, merci encore à toi "sabotage".

J'ai cependant encore un problème. En effet, lorsque le formulaire est envoyé une fenêtre apparaît avec un message que j'ai créé, ainsi la personne qui a complété le formulaire est informée que ses données ont bien été transmises. Maintenant, je souhaiterais personnaliser l'aspect de cette fenêtre (dimensions, couleur de fond, police, etc.). Tout d'abord est-ce possible et si oui, je serai preneur de quelques tips.

Un grand merci d'avance à celles et ceux qui pourront me venir en aide dans ma quête. A toute fin utile, voici le code du formulaire et de la page de traitement.

Formulaire html:
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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans nom</title>
<link href="StyleCSS.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
<!--
.Style2 {
	color: #000000;
	font-weight: normal;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.Style4 {
	color: #006666;
	font-weight: bold;
	font-size: 14px;
}
.Style6 {font-style: italic; color: #666666;}
.Style7 {
	color: #006666;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 16px;
}
-->
</style>
</head>
 
<body>
<div id="page">
   <div id="bandeau">
     <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','height','100','src','flash/BandeauIdentifierComprendreAgirStatique','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/BandeauIdentifierComprendreAgirStatique' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="100">
       <param name="movie" value="flash/BandeauIdentifierComprendreAgirStatique.swf" />
       <param name="quality" value="high" />
       <embed src="flash/BandeauIdentifierComprendreAgirStatique.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="100"></embed>
     </object>
   </noscript></div>
<div id="menu">
     <ul>
       <li><a href="index.html">Accueil</a></li>
       <li><a href="formations&amp;seminaires.html">Formations &amp; séminaires</a></li>
       <li><a href="formulaire.html">Vos interlocuteurs</a></li>
       <li><a href="#">Nous contacter</a></li>
       <li><a href="#">Liens</a></li>
     </ul>
   </div>
  <div class="Style2" id="centre">
    <p class="Style7">Vos interlocuteurs</p>
    <form method="POST" action="traitementformulaire.php" name="formulaire">
<table width="644" border="0" cellpadding="5">
  <tr>
    <td class="Style20"><span class="Style20">Prénom :</span></td>
    <td class="Style20"><span class="Style20">
      <input type="text" name="prenom"/>
    </span></td>
  </tr>
  <tr>
    <td class="Style20"><span class="Style20">Nom :</span></td>
    <td class="Style20"><input type="text" name="nom"/></td>
  </tr>
  <tr>
    <td class="Style20"><span class="Style17"><span class="Style21">Adresse e-mail :</span></td>
    <td class="Style20"><span class="Style18"><input type="text" name="mail"/></span></td>
  </tr>
  <tr>
    <td class="Style20">Liste déroulante :</td>
    <td class="Style20"><select name="liste">    <option value="Choix 1">Choix 1    <option value="Choix 2">Choix 2    <option value="Choix 3">Choix 3</select></td>
  </tr>
  <tr>
    <td class="Style20">Cases à cocher :</td>
    <td class="Style20"><input type="checkbox" name="CHOIX" value="CASE 1"> CASE 1<br><input type="checkbox" name="CHOIX" value="CASE 2"> CASE 2<br><input type="checkbox" name="CHOIX" value="CASE 3"> CASE 3<br></td>
  </tr>
  <tr>
    <td class="Style20">Boutons radio:</td>
    <td class="Style20"><input type="radio" name="CHOX" value="Bouton 1"> Bouton 1<br><input type="radio" name="CHOX" value="Bouton 2"> Bouton 2<br><input type="radio" name="CHOX" value="Bouton 3" checked> Bouton 3<br></td>
  </tr>
  <tr valign="top">
    <td class="Style20"><span class="Style20">Commentaire :
    </span>  <span class="Style20"></br>
    </span></td>
    <td class="Style20"><span class="Style18"></span><span class="Style20">
      <textarea name="commentaire" cols="60" rows="8"></textarea>
    </span></td>
  </tr>
</table>
<p>
<!-- Bouton envoyer-->
<input type="submit" value="Envoyer">
 
<!-- Bouton annuler-->
<input type="reset" value="Annuler">
</form>
<br/>
<br/></p>
  </div>
  <div id="pied">
    <div align="right">Copyright, MVT, juillet 2008</div>
  </div>
</div>         
 
</body>
</html>
Traitement formulaire
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Traitement formulaire</title>
</head>
 
<body>
<?php 
$Mail = $_POST['mail'];
$Nom = $_POST['nom'];
$Prenom = $_POST['prenom'];
$Liste = $_POST['liste'];
$Choix = $_POST['CHOIX'];
$Chox = $_POST['CHOX'];
$Commentaire = $_POST['commentaire'];
 
if(!empty($Mail) && !empty($Prenom) && !empty($Nom) ){
 
  $Commentaire = htmlentities($Commentaire);
 
 
  $index = "$Prenom\n $Nom\n vous contact via votre formulaire de demande de renseinements MVTR.\n \n Mail: $Mail\n Liste: $Liste\n Choix: $Choix\n Chox: $Chox\n message : \n $Commentaire";
 
 
  if( mail('philippe.zin@phzi.ch','Demande de renseignements MVTR',$index) ){
    echo'<font face="verdana"><p>Merci,<br />
  <br />
  Votre formulaire nous est bien parvenu.
  <br>
  Le cas échéant, nous ne manquerons pas de vous rendre réponse ou de prendre contact avec vous<br />
  dans les plus brefs délais<br>
  Avec nos meilleurs messages<br />
  ______________________________</p>
<blockquote>
  <blockquote>    Team MVT    </blockquote>
</blockquote>
<input type="" value="Envoyer">
</font face>';
  }
  else{
    echo 'une erreur est survenu lors de l\'envoi du message';
  }
}
  else{
 
    echo 'Veuillez compléter les champs nom, prenom et mail, merci';
}
 
?>
</body>
</html>
phil1964 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/08/2008, 15h14   #2
Modérateur
 
Avatar de sabotage
 
Homme Vincent
Inscription : juillet 2005
Messages : 14 929
Détails du profil
Informations personnelles :
Nom : Homme Vincent

Informations forums :
Inscription : juillet 2005
Messages : 14 929
Points : 16 383
Points : 16 383
Dans le cas ok tu ouvres un popup en javascript :
Code :
1
2
3
4
 
<script langage="javascript">
window.open("popup.html","PopUp","width=500,height=350,location=no,status=no,toolbar=no,scrollbars=no");
</script>
popup.html :
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
.popup {
	background-color : #59848F;
	color : #484727;
	font-family: arial;
}
</style>
<title>Merki !</title>
<body>
<div class="popup">
 
Votre formulaire nous est bien parvenu.
  <br>
  Le cas échéant, nous ne manquerons pas de vous rendre réponse ou de prendre contact avec vous<br />
  dans les plus brefs délais<br>
  Avec nos meilleurs messages<br />
  ______________________________</p>
 
  <blockquote>    Team MVT    </blockquote>
 
</div>
</body>
</html>
sabotage 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 05h08.


 
 
 
 
Partenaires

Hébergement Web