This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
|
||||
// Autoriser uniquement les requêtes POST
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
http_response_code(405);
|
||||
echo json_encode(['success' => false, 'message' => 'Méthode non autorisée.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Protection anti-spam (honeypot)
|
||||
if (!empty($_POST['website'])) {
|
||||
http_response_code(400);
|
||||
echo json_encode(['success' => false, 'message' => 'Spam détecté.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Récupération et nettoyage des champs
|
||||
$nom = trim(strip_tags($_POST['nom'] ?? ''));
|
||||
$email = trim(strip_tags($_POST['email'] ?? ''));
|
||||
$message = trim(strip_tags($_POST['message'] ?? ''));
|
||||
|
||||
// Validation
|
||||
$errors = [];
|
||||
if (empty($nom)) $errors[] = 'Le nom est requis.';
|
||||
if (empty($email)) $errors[] = "L'adresse email est requise.";
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) $errors[] = "L'adresse email n'est pas valide.";
|
||||
if (empty($message)) $errors[] = 'Le message est requis.';
|
||||
if (strlen($message) > 5000) $errors[] = 'Le message est trop long (5000 caractères max).';
|
||||
|
||||
if (!empty($errors)) {
|
||||
http_response_code(422);
|
||||
echo json_encode(['success' => false, 'message' => implode(' ', $errors)]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Destinataire
|
||||
$to = 'contact@la-maison-de-cecile.fr';
|
||||
$subject = '=?UTF-8?B?' . base64_encode('[La Maison de Cécile] Message de ' . $nom) . '?=';
|
||||
|
||||
// Corps du mail
|
||||
$body = "Vous avez reçu un nouveau message via le formulaire de contact.\n\n";
|
||||
$body .= "Nom : {$nom}\n";
|
||||
$body .= "Email : {$email}\n";
|
||||
$body .= "Message:\n{$message}\n";
|
||||
|
||||
// En-têtes
|
||||
$headers = "From: =?UTF-8?B?" . base64_encode($nom) . "?= <no-reply@la-maison-de-cecile.fr>\r\n";
|
||||
$headers .= "Reply-To: {$email}\r\n";
|
||||
$headers .= "MIME-Version: 1.0\r\n";
|
||||
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
|
||||
$headers .= "Content-Transfer-Encoding: base64\r\n";
|
||||
|
||||
$success = mail($to, $subject, base64_encode($body), $headers);
|
||||
|
||||
if ($success) {
|
||||
echo json_encode(['success' => true, 'message' => 'Votre message a bien été envoyé. Nous vous répondrons sous 24h.']);
|
||||
} else {
|
||||
http_response_code(500);
|
||||
echo json_encode(['success' => false, 'message' => "Une erreur s'est produite. Veuillez réessayer ou nous contacter par téléphone."]);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 58 KiB |
+163
-8
@@ -1,9 +1,164 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
||||
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
|
||||
<style>
|
||||
path { fill: #000; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #FFF; }
|
||||
}
|
||||
</style>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 512 512"
|
||||
role="img"
|
||||
aria-labelledby="title desc">
|
||||
<title id="title">La Maison de Cécile — favicon maison rivière pont</title>
|
||||
<desc id="desc">Icône simple avec maison blanche, toit couleur tuile, pont en arc et rivière bleue en forme de S.</desc>
|
||||
|
||||
<defs>
|
||||
<clipPath id="circleClip">
|
||||
<circle cx="256" cy="256" r="240"/>
|
||||
</clipPath>
|
||||
|
||||
<linearGradient id="backgroundGradient" x1="256" y1="16" x2="256" y2="496" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#7EA35F"/>
|
||||
<stop offset="1" stop-color="#3F703A"/>
|
||||
</linearGradient>
|
||||
|
||||
<linearGradient id="riverGradient" x1="210" y1="230" x2="285" y2="505" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#8CC2C6"/>
|
||||
<stop offset="1" stop-color="#4E8F9A"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<!-- Background circle -->
|
||||
<circle cx="256" cy="256" r="240" fill="url(#backgroundGradient)"/>
|
||||
|
||||
<g clip-path="url(#circleClip)">
|
||||
<!-- Distant soft hill -->
|
||||
<path
|
||||
d="M-20 242
|
||||
C70 210 145 220 220 250
|
||||
C315 288 392 240 532 210
|
||||
L532 512 L-20 512 Z"
|
||||
fill="#5D8749"
|
||||
opacity="0.72"/>
|
||||
|
||||
<!-- Left foreground hill -->
|
||||
<path
|
||||
d="M-20 360
|
||||
C65 292 150 282 235 338
|
||||
C170 405 100 455 -20 512 Z"
|
||||
fill="#315F31"/>
|
||||
|
||||
<!-- Right foreground hill -->
|
||||
<path
|
||||
d="M532 350
|
||||
C455 286 360 283 280 338
|
||||
C350 414 430 465 532 512 Z"
|
||||
fill="#315F31"/>
|
||||
|
||||
<!-- River body, S shape -->
|
||||
<path
|
||||
d="M279 247
|
||||
C226 275 224 313 267 337
|
||||
C315 364 323 404 272 430
|
||||
C235 449 206 470 198 512
|
||||
L351 512
|
||||
C373 466 359 431 320 407
|
||||
C280 382 286 358 330 334
|
||||
C381 306 380 264 322 239
|
||||
Z"
|
||||
fill="url(#riverGradient)"/>
|
||||
|
||||
<!-- River white banks/highlights -->
|
||||
<path
|
||||
d="M284 259
|
||||
C238 282 242 309 277 327
|
||||
C326 352 337 400 282 426"
|
||||
fill="none"
|
||||
stroke="#FFFFFF"
|
||||
stroke-width="16"
|
||||
stroke-linecap="round"
|
||||
opacity="0.95"/>
|
||||
|
||||
<path
|
||||
d="M221 452
|
||||
C247 436 280 429 303 406"
|
||||
fill="none"
|
||||
stroke="#FFFFFF"
|
||||
stroke-width="13"
|
||||
stroke-linecap="round"
|
||||
opacity="0.95"/>
|
||||
|
||||
<!-- Bridge deck -->
|
||||
<path
|
||||
d="M82 336
|
||||
C148 300 204 283 256 283
|
||||
C308 283 364 300 430 336
|
||||
L430 373
|
||||
C365 336 309 319 256 319
|
||||
C203 319 147 336 82 373 Z"
|
||||
fill="#E7DFC8"/>
|
||||
|
||||
<!-- Bridge arch cutout -->
|
||||
<path
|
||||
d="M204 372
|
||||
C213 333 299 333 308 372
|
||||
L308 410
|
||||
L204 410 Z"
|
||||
fill="#315F31"/>
|
||||
|
||||
<!-- Subtle bridge outline -->
|
||||
<path
|
||||
d="M87 336
|
||||
C150 302 205 286 256 286
|
||||
C307 286 362 302 425 336"
|
||||
fill="none"
|
||||
stroke="#FFFFFF"
|
||||
stroke-width="8"
|
||||
stroke-linecap="round"
|
||||
opacity="0.95"/>
|
||||
|
||||
<!-- House body -->
|
||||
<rect x="173" y="165" width="166" height="126" rx="6" fill="#FFFFFF"/>
|
||||
|
||||
<!-- Roof fill -->
|
||||
<path
|
||||
d="M151 170
|
||||
L256 78
|
||||
L361 170
|
||||
L343 190
|
||||
L256 113
|
||||
L169 190 Z"
|
||||
fill="#C96F3A"/>
|
||||
|
||||
<!-- Roof underside / clean edge -->
|
||||
<path
|
||||
d="M171 181
|
||||
L256 108
|
||||
L341 181"
|
||||
fill="none"
|
||||
stroke="#B95F32"
|
||||
stroke-width="13"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"/>
|
||||
|
||||
<!-- Chimney -->
|
||||
<rect x="306" y="102" width="30" height="68" rx="5" fill="#FFFFFF"/>
|
||||
|
||||
<!-- Repaint roof over chimney base for clean overlap -->
|
||||
<path
|
||||
d="M151 170
|
||||
L256 78
|
||||
L361 170"
|
||||
fill="none"
|
||||
stroke="#C96F3A"
|
||||
stroke-width="22"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"/>
|
||||
|
||||
<!-- Door -->
|
||||
<rect x="207" y="231" width="33" height="60" rx="4" fill="#315F31"/>
|
||||
|
||||
<!-- Window -->
|
||||
<g fill="#315F31">
|
||||
<rect x="272" y="212" width="20" height="20" rx="3"/>
|
||||
<rect x="300" y="212" width="20" height="20" rx="3"/>
|
||||
<rect x="272" y="240" width="20" height="20" rx="3"/>
|
||||
<rect x="300" y="240" width="20" height="20" rx="3"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 4.1 KiB |
Reference in New Issue
Block a user