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.
Configuration: Mac OS X
Safari 525.22