Merge branch 'master' of https://github.com/jsmaniac/2011-m1s2-ter
This commit is contained in:
commit
5da39bbdba
|
@ -1,5 +1,31 @@
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
$displayForm = true;
|
||||||
|
|
||||||
|
if(isset($_POST['email']) && isset($_POST['subject']) && isset($_POST['message']))
|
||||||
|
if(!empty($_POST['email']) && !empty($_POST['subject']) && !empty($_POST['message']))
|
||||||
|
{
|
||||||
|
$from = $_POST['email'];
|
||||||
|
$subject = $_POST['subject'];
|
||||||
|
$header = 'From: '.$from . "\r\n" .
|
||||||
|
'Reply-To: '.$from . "\r\n" .
|
||||||
|
'X-Mailer: PHP/' . phpversion();
|
||||||
|
$dest = $EmailAddress;
|
||||||
|
$message = str_replace("\r\n","\n",$_POST['message']);
|
||||||
|
|
||||||
|
if(mail($dest,$subject,$message,$header))
|
||||||
|
{
|
||||||
|
$notif = "Votre email à été envoyé";
|
||||||
|
$displayForm = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$notif = "Une erreur s'est produite lors de l'envoi du message";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$notif = "Veuillez remplir tout les champs";
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
|
@ -16,7 +42,50 @@ session_start();
|
||||||
<?php include("ressources/menu.html"); ?>
|
<?php include("ressources/menu.html"); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Le contenu.
|
if(isset($notif))
|
||||||
|
if($dspForm == true)
|
||||||
|
echo '<span class="warning">'.$notif.'</span>';
|
||||||
|
else
|
||||||
|
echo '<span class="notifOK">'.$notif.'</span>';
|
||||||
|
|
||||||
|
if($dspForm == true)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<form action="contact.php" method="POST">
|
||||||
|
<table class="formTbl1">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="email">Votre e-mail : </label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="email" name="email" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="sujet">Objet du mail : </label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="sujet" name="sujet" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="message">Votre message : </label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<textarea class="txMessage" id="message" name="message"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<span class="btSubmit"><input type="submit" value="Envoyer le message" /></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<?php include("ressources/footer.html"); ?>
|
<?php include("ressources/footer.html"); ?>
|
||||||
|
|
|
@ -8,7 +8,7 @@ if(isset($_POST['loginpswd']) && !empty($_POST['loginpswd']))
|
||||||
if(isset($_GET['return']))
|
if(isset($_GET['return']))
|
||||||
$location = $_GET['return'];
|
$location = $_GET['return'];
|
||||||
else
|
else
|
||||||
$location = "contact.php";
|
$location = "index.php";
|
||||||
|
|
||||||
if(isset($_GET['d']) && $_GET['d'] == "true") {
|
if(isset($_GET['d']) && $_GET['d'] == "true") {
|
||||||
session_destroy();
|
session_destroy();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user