<span class="little"><?php echo $Txt['GENERAL']; ?> &gt; <?php echo $Txt['CONTACT']; ?></span><br>

<span class="title"><?php echo $Txt['QUESTION_CONTACT']; ?></span> 

<hr>

<?php

if(!isset($_POST['submit']))

				 {

?>

<form method="post" action="?page=contact">

<table align="center" width="100%">

<tr>

<td><?php echo $Txt['MAIL']; ?> :</td><td><input type="text" name="mail" <?php if(isset($_SESSION['id'])) { echo "value='". $user['email'] ."' readonly='readonly'"; } ?> /></td>

</tr>

<tr>

<td><?php echo $Txt['NOM']; ?> :</td><td><input type="text" name="nom" <?php if(isset($_SESSION['id'])) { echo "value='". $user['last_name'] ."' readonly='readonly'"; } ?> /></td>

</tr>

<tr>

<td><?php echo $Txt['PRENOM']; ?> :</td><td><input type="text" name="prenom" <?php if(isset($_SESSION['id'])) { echo "value='". $user['first_name'] ."' readonly='readonly'"; } ?> /></td>

</tr>

<tr>

<td><?php echo $Txt['SUJET']; ?> :</td><td><input type="text" name="sujet" /></td>

</tr>

<tr>

<td valign="top"><?php echo $Txt['MESSAGE']; ?> :</td><td><textarea name="message" cols="60" rows="10"></textarea></td>

</tr>

<tr><td></td><td><input type="submit" name="submit" value="Envoyer !" /></td></tr>

</table>

</form>

<?php

				 }

				 else

				 {

					 

					 if(isset($_POST['mail']) and $_POST['mail'] != "" and isset($_POST['nom']) and $_POST['nom'] != "" and isset($_POST['prenom']) and $_POST['prenom'] != "" and isset($_POST['sujet']) and $_POST['sujet'] != "" and isset($_POST['message']) and $_POST['message'] != "")

					 {

					 

if(isset($_SESSION['id'])) { $pseudocontact = pseudo_id($_SESSION['id']); } else { $pseudocontact = "Visiteur"; }

					 

$boundary = "-----=" . md5( uniqid ( rand() ) );

$headers = "Reply-to: \"". $_POST['nom'] ." ". $_POST['prenom'] ."\"<". $_POST['mail'] .">\n";

$headers .= "From: \"". $_POST['nom'] ." ". $_POST['prenom'] ."\"<". $_POST['mail'] .">\n";



$headers .= "MIME-Version: 1.0\n";

$headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\"";



$destinataire = "webmaster@zonedactylo.com";



$subject = "ZoneDactylo (formulaire de contact) : ". $_POST['sujet'] ."";



$message_txt  = "". $_POST['nom'] ." ". $_POST['prenom'] ." a rempli le formulaire de contact de zonedactylo.\n\n

				Pseudo : ". $pseudocontact ."

				Sujet :\n". $_POST['sujet'] ."\n

				Message :\n". $_POST['message'] ."\n\n

				Vous pouvez recontacter ". (isset($_POST['titre']) ? $_POST['titre'] : '') ." ". $_POST['nom'] ." ". $_POST['prenom'] ." à l'adresse e-mail suivante : ". $_POST['mail'] ."\n\n

				www.zonedactylo.com

				";



$message_html  = "<html>\n";

$message_html .= "<body>\n";

$message_html .= "<center><b><u>". $_POST['nom'] ." ". $_POST['prenom'] ." a rempli le formulaire de contact de zonedactylo.</u></b></center><br /><br />

				<b><u>Pseudo :</u></b> ". $pseudocontact ."<br />

				<b><u>Sujet :</u></b><br />". $_POST['sujet'] ."<br />

				<b><u>Message :</u></b><br />". $_POST['message'] ."<br /><br />

				Vous pouvez recontacter ". (isset($_POST['titre']) ? $_POST['titre'] : '') ." ". $_POST['nom'] ." ". $_POST['prenom'] ." à l'adresse e-mail suivante : ". $_POST['mail'] ."<br /><br />

				www.zonedactylo.com

				";

$message_html .= "</body>\n";

$message_html .= "</html>\n";



$message  = "This is a multi-part message in MIME format.\n\n";

$message .= "--" . $boundary . "\n";

$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";

$message .= "Content-Transfer-Encoding: quoted-printable\n\n";

$message .= stripslashes($message_txt);

$message .= "\n\n";

$message .= "--" . $boundary . "\n";

$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";

$message .= "Content-Transfer-Encoding: quoted-printable\n\n";

$message .= stripslashes($message_html);

$message .= "\n\n";

$message .= "--" . $boundary . "--\n";



if(mail($destinataire, $subject, $message, $headers))

{

	echo $Txt['CONTACT_SUCCES'];

}

else

{

	echo $Txt['CONTACT_ERREUR_ENVOI'];



}

					 }

					 else

					 {

			echo "". $Txt['CHAMPS_OBLIGATOIRES'] ." <a href='?page=contact'>". $Txt['CLIQUE_RECOMMENCE'] .".</a>";

					 }

				 }

?>