diff --git a/public/contact/config.php.dist b/public/contact/config.php.dist new file mode 100644 index 0000000..e69de29 diff --git a/public/contact/how_do_u_say.txt b/public/contact/how_do_u_say.txt new file mode 100644 index 0000000..62a56ee --- /dev/null +++ b/public/contact/how_do_u_say.txt @@ -0,0 +1,27 @@ +dodeldirer +gazouiller +glouglotter +glousser +jacasser +jaser +pépier +piailler +pirouitter +pituiter +roucouler +siffler +tire-lirer +zinzibuler +zinzinuler +chanter +cancaner +nasiller +coqueliner +coqueriquer +caquetter +cocailler +coclorer +codequer +coucasser +creteller + diff --git a/public/contact/index.php b/public/contact/index.php index cf0f274..63dbd77 100644 --- a/public/contact/index.php +++ b/public/contact/index.php @@ -1,5 +1,20 @@ getMessage(); + $say = "caqueter"; +} ?> @@ -12,10 +27,52 @@ $root = $_SERVER['DOCUMENT_ROOT']; - - +
+ + +
- +
+
+

Babillons ensemble !

+ +
+ +
+ +
+ + + + + + + + + + + +
+

* obligatoire

+ +
+ +
+ +
+
diff --git a/public/contact/send.php b/public/contact/send.php new file mode 100644 index 0000000..8a8478b --- /dev/null +++ b/public/contact/send.php @@ -0,0 +1,122 @@ +SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output + $mail->isSMTP(); //Send using SMTP + $mail->Host = $smtp_host; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = $smtp_username; //SMTP username + $mail->Password = $smtp_password; //SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged + $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + + //Recipients + $mail->setFrom($smtp_from, 'Mailer'); + foreach ($smtp_addresses as $address) + { + $mail->addAddress($address['email'], $address['user']); //Add a recipient + } + $mail->addReplyTo($email, $name); + // $mail->addCC('cc@example.com'); + // $mail->addBCC('bcc@example.com'); + + //Attachments + // $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments + // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name + //Content + $mail->isHTML(true); + $mail->CharSet = 'UTF-8'; + $mail->Encoding = 'base64'; //Set email format to HTML + $mail->Subject = $subject; + $content = ""; + $content .= "Message en provenance de la page contact des cocottes:
"; + $content .= "De: ".$name.' '.$email."
"; + if ($website != "") + { + $content .= 'Site web: ' . $website ."
"; + } + $content .= "
"; + $content .= $message; + $mail->Body = $content; + + $mail->AltBody = $message; + + $mail->send(); + $_SESSION['msg'] .= "Votre gazouilli a bien été envoyé \\o/.\n"; + } catch (Exception $e) { + $_SESSION['error_msg'] .= "Votre gazouilli n'a malheureusement pas pu être envoyé. \n Mailer Error: {$mail->ErrorInfo}"; + } +} + +$_SESSION['error_msg'] = ""; +$_SESSION['msg'] = ""; + +if (isset($_POST['submit'])) +{ + if (isset($_POST['name']) and $_POST['name'] != "") + { + $name = $_POST['name']; + } else + { + $_SESSION['error_msg'] .= "Mais quel est votre nom, chère cocotte ?\n"; + } + if (isset($_POST['email']) and $_POST['email'] != "") + { + $email = $_POST['email']; + } else + { + $_SESSION['error_msg'] .= "Et votre email ?\n"; + } + if (isset($_POST['website']) and $_POST['website'] != "") + { + $website = $_POST['website']; + } else { + $website = ""; + } + if (isset($_POST['subject']) and $_POST['subject'] != "") + { + $subject = $_POST['subject']; + } else + { + $_SESSION['error_msg'] .= "De quoi voulez vous nous parler ?"; + } + if (isset($_POST['message']) and $_POST['message'] != "") + { + $message = $_POST['message']; + } else + { + $_SESSION['error_msg'] .= "Vous caqueter bien faiblement ma pauvre cocotte, vous n'aviez rien à nous dire ?\n"; + } +} else +{ + $_SESSION['error_msg'] .= "Vous n'avez pas soumis le formulaire de contact.\n"; +} + + +if ($_SESSION['error_msg'] == "") +{ + send($name, $email, $website, $subject, $message); +} +// echo $_SESSION['error_msg']; +// echo $_SESSION['msg']; +header('Location: /contact'); +?> \ No newline at end of file