Pb création formulaire PHP Dreamweaver 8

Fermé
NathalieR Messages postés 4 Date d'inscription samedi 11 octobre 2008 Statut Membre Dernière intervention 11 octobre 2008 - 11 oct. 2008 à 17:03
 Ely - 27 févr. 2009 à 17:22
Bonjour tout le monde,

Je débute en matière de code, script et autres. Je fais principalement de la création graphique. Mais pour les besoins de mon propre site, je me suis mise à l'élaboration d'un formulaire de prise de contact destiné aux visiteurs et dont je souhaiterais que l'envoi se fasse sur un compte mail précis. Je suis actuellement hébergée sur monhosteur.com et ils m'ont conseillé de faire ce formulaire en PHP, ce que je ne maîtrise absolument pas. L'HTML, un peu, mais le PHP, c'est tout nouveau et je patauge pour de bon avec tout le jargon ! Ce que j'aimerais si possible, c'est une marche à suivre accessible pour une néophyte, j'utilise essentiellement Dreamweaver dans sa fonction graphique (pas code ou très peu), avec les infos pour renseigner les champs du formulaire dans la fenêtre Propriétés. Que mettre dans les champs action, méthode, enctype, ... ? Mon formulaire est assez simple, j'ai déjà fait la mise en page et il comprend un champ pour l'adresse mail du visiteur, une zone de texte pour taper son message et 2 boutons envoyer et rétablir. Dans l'idéal, j'aimerais que l'envoi du formulaire soit suivi d'une page avec un message type du genre : Votre message a bien été transmis et une possibilité de rendre la saisie de l'adresse mail du visiteur obligatoire. Voici l'url (http://www.dclic-graphic.com/mecontacter.html) de ma page avec le formulaire qui ne fonctionne pas pour que vous puissiez vous faire une idée du graphisme (sur Dreamweaver c'est pour le moment une page.html mais je sais qu'il faut faire une page.php pour intégrer du PHP dans le code HTML. Faut-il commencer par changer l'extension de la page ?) car je sais qu'il existe des générateurs de code PHP sur internet mais comment, où intégrer leurs codes sans dénaturer la charte graphique du site et de la page ? Voici aussi le code de ma page aujourd'hui, je ne sais pas si c'est utile de vous le mettre là mais de cette manière, vous aurez, il me semble, l'ensemble des éléments :

<!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=ISO-8859-1" />
<title>D-clic GRAPHIC</title>
<style type="text/css">
<!--
body {
margin-top: 50px;
margin-bottom: 50px;
}
.menu {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #000000;
}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
}
-->
</style>
<link href="css/coordonnees.css" rel="stylesheet" type="text/css" />
<link href="css/graphismepage.css" rel="stylesheet" type="text/css" />
<link href="css/rubrique.css" rel="stylesheet" type="text/css" />
<link href="css/menublanc.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Style7 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
-->
</style>
<link href="css/accueilpage.css" rel="stylesheet" type="text/css" />
<link href="css/mecontacterpage.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Style9 {color: #000000}
-->
</style>
<link href="css/formulaire.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
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); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<div align="center">
<table width="728" height="573" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width="728" height="573" align="left" valign="top"><table width="728" height="573" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td width="728" height="573" align="left" valign="top"><table width="728" height="573" cellpadding="0" cellspacing="0">
<tr>
<td width="728" height="198" align="left" valign="top"><table width="728" height="198" cellpadding="0" cellspacing="0">
<tr>
<td width="278" height="198" align="left" valign="top"><table width="278" height="198" cellpadding="0" cellspacing="0">
<tr>
<td width="278" height="168" align="left" valign="top"><table width="278" height="168" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="168" align="center" valign="middle"><img src="images/logo.jpg" width="107" height="126" longdesc="images/logo.jpg" /></td>
<td width="158" height="168" align="center" valign="middle"><table width="158" cellspacing="0" cellpadding="0">
<tr>
<td width="158" height="15" align="left" valign="top" class="accroche"><div align="justify" class="graphismepage">D-clic GRAPHIC </div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify" class="graphismepage">le graphisme indépendant </div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify"><span class="coordonnees"><strong>NATHALIE REBATET </strong></span></div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify"><span class="coordonnees">Mobile : 06 87 13 70 11 </span></div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify"><span class="coordonnees">Fax : 04 78 91 05 10 </span></div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify"><span class="coordonnees">174 Rue Claire Combe</span></div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify"><span class="coordonnees">01390 Tramoyes</span></div></td>
</tr>
<tr>
<td width="158" height="10" align="left" valign="top"><div align="justify"><span class="coordonnees">E-mail : infos@dclic-graphic.fr </span></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="278" height="30" align="left" valign="top"><table width="278" height="30" cellpadding="0" cellspacing="0">
<tr>
<td width="108" height="30"> </td>
<td width="20" height="30" align="center" valign="middle"><img src="images/puce.gif" width="20" height="30" longdesc="images/puce.gif" /></td>
<td width="150" height="30" align="left" valign="middle"><div align="center" class="accroche">
<div align="justify" class="rubrique">me contacter </div>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="450" height="198" align="left" valign="top"><img src="images/bandeau.gif" width="450" height="198" longdesc="images/bandeau.gif" /></td>
</tr>
</table></td>
</tr>
<tr>
<td width="728" height="375" align="left" valign="top" bgcolor="#A6442B"><table width="728" height="375" cellpadding="0" cellspacing="0" background="images/fond1.gif">
<tr>
<td width="728" height="20" align="left" valign="top"><table width="728" height="20" cellpadding="0" cellspacing="0">
<tr>
<td width="100" height="20"> </td>
<td width="80" height="20" align="center" valign="bottom" class="menublanc"><div align="center" class="menublanc"><a href="quisuis_je.html" class="menublanc">QUI SUIS-JE ? </a></div></td>
<td width="7" height="20" align="left" valign="top"><img src="images/filet_menubis1.gif" width="7" height="20" longdesc="images/filet_menubis.gif" /></td>
<td width="170" height="20" align="center" valign="bottom"><div align="center" class="menublanc"><a href="conseil.html">CONSEIL EN COMMUNICATION </a></div></td>
<td width="7" height="20" align="left" valign="top"><img src="images/filet_menubis2.gif" width="7" height="20" longdesc="images/filet_menubis2.gif" /></td>
<td width="160" height="20" align="center" valign="bottom"><div align="center" class="menublanc"><a href="logo.html">LOGO/CHARTE GRAPHIQUE </a></div></td>
<td width="7" height="20" align="left" valign="top"><img src="images/filet_menubis3.gif" width="7" height="20" longdesc="images/filet_menubis3.gif" /></td>
<td width="50" height="20" align="center" valign="bottom"><div align="center" class="menublanc"><a href="edition.html">ÉDITION</a></div></td>
<td width="7" height="20" align="left" valign="top"><img src="images/filet_menubis4.gif" width="7" height="20" longdesc="images/filet_menubis4.gif" /></td>
<td width="40" height="20" align="center" valign="bottom"><div align="center" class="menublanc"><a href="web.html">WEB</a></div></td>
<td width="7" height="20" align="left" valign="top"><img src="images/filet_menubis5.gif" width="7" height="20" longdesc="images/filet_menubis5.gif" /></td>
<td width="80" height="20" align="center" valign="bottom" class="menublanc"><div align="center"><a href="relookage.html">RELOOKAGE</a></div></td>
<td width="13" height="20"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="728" height="335" align="left" valign="top"><table width="728" height="335" cellpadding="0" cellspacing="0">
<tr>
<td width="728" height="315" align="left" valign="top"><table width="728" height="315" cellpadding="0" cellspacing="0">
<tr>
<td width="230" height="315"> </td>
<td width="428" height="315" align="left" valign="top"><table width="428" height="315" cellpadding="0" cellspacing="0">
<tr>
<td width="428" height="50" align="left" valign="bottom"><div align="justify" class="mecontacterpage">Vous avez des questions, remarques, suggestions, ... N'hésitez pas ! </div></td>
</tr>
<tr>
<td width="428" height="230" align="left" valign="top" class="mecontacterpage"><table width="436" cellspacing="0" cellpadding="0">
<tr>
<td width="10" height="20" align="left" valign="top"> </td>
<td width="398" height="20" align="left" valign="top"> </td>
<td width="30" height="20"> </td>
</tr>
<tr>
<td width="10" height="100" align="left" valign="top"> </td>
<td width="398" height="100" align="left" valign="top"><form action="http://dclic-graphic.com/cgi-sys/FormMail.cgi" method="post" enctype="multipart/form-data" name="contact" id="contact">
<table width="398" cellspacing="0" cellpadding="0">
<tr>
<td width="138" height="20" align="left" valign="middle" class="mecontacterpage"><div align="left">Votre e-mail : </div></td>
<td width="260" height="20" align="left" valign="middle"><input name="FROM" type="text" class="formulaire" id="FROM" onblur="MM_validateForm('FROM','','RisEmail');return document.MM_returnValue" size="40" /></td>
</tr>
<tr>
<td width="138" height="20"> </td>
<td width="260" height="20"> </td>
</tr>
<tr>
<td width="138" height="20" align="left" valign="top"><div align="left">Votre message : </div></td>
<td width="260" height="20" align="left" valign="top"><textarea name="Votre message" cols="40" rows="5" wrap="physical" class="formulaire" id="Votre message"></textarea></td>
</tr>
<tr>
<td width="138" height="10"> </td>
<td width="260" height="10"><input name="TO" type="hidden" id="TO" value="infos@dclic-graphic.com" /></td>
</tr>
<tr>
<td width="138" height="20"> </td>
<td width="260" height="20" align="left" valign="top"><table width="260" height="20" cellpadding="0" cellspacing="0">
<tr>
<td width="90" height="20" align="left" valign="top"><input name="Envoyer" type="submit" class="formulaire" id="Envoyer" value="Envoyer" />
<input name="GOTOURL" type="hidden" id="GOTOURL" value="http://www.dclic-graphic.com/transmission.html" /></td>
<td width="170" height="20" align="left" valign="top"><input name="Rétablir" type="reset" class="formulaire" id="Rétablir" value="Rétablir" /></td>
</tr>
</table></td>
</tr>
</table>
</form> </td>
<td width="30" height="100"> </td>
</tr>
<tr>
<td width="10" height="10" align="left" valign="top"> </td>
<td width="398" height="10" align="left" valign="top"> </td>
<td width="30" height="10"> </td>
</tr>
<tr>
<td width="10" height="20" align="left" valign="top"> </td>
<td width="398" height="20" align="left" valign="top" class="menublanc"><div align="left"><a href="mailto:infos@dclic-graphic.com">E-mail : infos@dclic-graphic.com</a></div></td>
<td width="30" height="20"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="428" height="10"> </td>
</tr>
</table></td>
<td width="70" height="315"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="728" height="20" align="left" valign="top"><table width="728" height="20" cellpadding="0" cellspacing="0">
<tr>
<td width="484" height="20"> </td>
<td width="65" height="20" align="center" valign="middle"><div align="center"><span class="accueil Style7"><a href="index.html" class="accueilpage">ACCUEIL</a></span></div></td>
<td width="19" height="20" align="left" valign="top"><img src="images/filet_accueil.gif" width="19" height="20" longdesc="images/filet_accueil.gif" /></td>
<td width="110" height="20" align="center" valign="middle"><div align="center" class="mecontacterpage"><a href="mecontacter.html">ME CONTACTER </a></div></td>
<td width="50" height="20"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>

UN ÉNORME MERCI PAR AVANCE AUX PERSONNES QUI ME DONNERONT UN PEU DE LEURS TEMPS ET DE LEURS SAVOIRS.

Bon week-end à tous.
A voir également:

7 réponses

Mattle91 Messages postés 27 Date d'inscription jeudi 30 août 2007 Statut Membre Dernière intervention 11 octobre 2008 1
11 oct. 2008 à 19:00
Ah, j'ai oublié de te préciser quelque chose. Lorsque tu visualises la page avec le formulaire sur ton ordinateru, c'est normal qu'elle ne s'affiche pas correctement, et qu'il ait des bout de codes dans les différents champs. Il faut que tu essaye en mettant ta page sur ton serveur.
1
Mattle91 Messages postés 27 Date d'inscription jeudi 30 août 2007 Statut Membre Dernière intervention 11 octobre 2008 1
11 oct. 2008 à 17:20
Salut,

Moi aussi, dans mes début, j'ai pataugé pour faire un formulaire de contact.
Mais heuresement, que j'ai trouvé ce site qui m'a permis de le faire très facilement: http://www.ge-net.ch/page/rw-wfco-int-0.html
Tu as juste à choisir les différents type de champ que tu veux mettre, puis tu place le code qu'il te donne à l'endroit qu'il t'indique.
Voila, le tour est joué !
Mais attention, ta page doit avoir l'extension .php Par exemple: http://www.dclic-graphic.com/mecontacter.php
0
NathalieR Messages postés 4 Date d'inscription samedi 11 octobre 2008 Statut Membre Dernière intervention 11 octobre 2008
11 oct. 2008 à 18:04
Merci beaucoup pour cette réponse. Ce lien devrait m'être très utile en effet. Mais juste une petite précision. Où insérer ces sections de code pour ne pas chambouler ma mise en page et charte graphique actuelles ? Car je voudrais pouvoir conserver mon graphisme en l'état : la couleur de fond, la typo, le texte avant le formulaire, faire en sorte que le formulaire se situe au même endroit que l'actuel, ...

Ca fait beaucoup de questions je sais mais je tiens à mon graphisme.

Et encore merci pour ce lien et cette réponse rapide.
0
Mattle91 Messages postés 27 Date d'inscription jeudi 30 août 2007 Statut Membre Dernière intervention 11 octobre 2008 1
11 oct. 2008 à 18:30
Le premier code, tu le place avant la balise <html>
Le second code, tu le place entre <head> et </head>
Le dernier bout de code, c'est le formulaire en lui même. Sur Dreamweaver, quand tu es avec l'onglet création, tu place ton curseur la où tu voudrai que ton formulaire soit. Puis tu prends l'onglet code et tu colles ce dernier bon de code.
Pour ce qui est du graphique, je ne pense pas qu'il soit chamboulé. Mais cependant, fait des essais avec d'autres pages, car au cas-ou il changerai, tu pourra récupérer la bonne page.
J'espère avoir été clair :)
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
NathalieR Messages postés 4 Date d'inscription samedi 11 octobre 2008 Statut Membre Dernière intervention 11 octobre 2008
11 oct. 2008 à 18:35
Très et merci encore pour ta réponse. Je vais suivre ton conseil et voir ce que ça donne.
0
NathalieR Messages postés 4 Date d'inscription samedi 11 octobre 2008 Statut Membre Dernière intervention 11 octobre 2008
11 oct. 2008 à 21:57
Ca marche super ! J'ai pu conserver mon graphisme en retouchant par petites touches le code au niveau des polices, couleurs, ... Et j'ai testé, je reçois le formulaire impeccablement au mail souhaité. PARFAIT. Ce lien c'est l'idéal pour les personnes comme moi qui rament avec le PHP. C'est beaucoup plus simple de cette façon.

Merci pour toutes tes précisions. Elles m'ont beaucoup aidé et retiré une sacré épine du pied !
0
C'est vraiment merveilleux ce générateur de formulaire :D
0