Add user should work

This commit is contained in:
Bertrand 2012-06-19 19:32:41 +02:00
parent 60cea68a0d
commit 4aab9f87f9
2 changed files with 29 additions and 4 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
include("header.html");
include("User.class.php"); include("User.class.php");
$email = $_POST['email']; $email = $_POST['email'];
@ -21,7 +22,6 @@ function mail_utf8($to, $subject = '(No subject)',
} }
$email = $_POST['email']; $email = $_POST['email'];
echo $email;
$subject = "[Nemubot] Confirmation d'inscription"; $subject = "[Nemubot] Confirmation d'inscription";
$headers = "From: Nemubot <bot@nemunai.re>\n"; $headers = "From: Nemubot <bot@nemunai.re>\n";
$message = "Bonjour,\n" $message = "Bonjour,\n"
@ -40,11 +40,35 @@ $message = "Bonjour,\n"
if (mail_utf8($email, $subject, $message, $headers)) if (mail_utf8($email, $subject, $message, $headers))
{ {
echo "\nemail sent"; $message = true;
} }
else else
{ {
echo "ERROR"; $message = false;
} }
?> ?>
<section id="introduction">
<article>
<?php
if ($message)
{
?>
<h2>Merci</h2>
<p>
Un email a été envoyé à l'adresse mail que vous avez précisé.
Cliquez sur le lien contenu dans l'email pour confirmer votre inscription.
</p>
<?php
} else {
?>
<h2>ERREUR</h2>
<p>Une erreur est survenue. Dommage.</p>
<?php } ?>
</article>
</section>
</body>
</html>

View File

@ -1,5 +1,6 @@
<?php <?php
include ("header.html");
include("User.class.php"); include("User.class.php");
$id = $_GET['id']; $id = $_GET['id'];