Fix issue on question.php -> Need to check email

This commit is contained in:
Bertrand 2012-05-23 16:30:48 +02:00
parent 829b392bca
commit 7e7b77769f
3 changed files with 12 additions and 15 deletions

4
email.txt Normal file
View File

@ -0,0 +1,4 @@
3
bertrand.cournaud@gmail.com
ircquizz@23.tf
ircquizz@p0m.fr

View File

@ -128,7 +128,7 @@
onclick="add()"/> onclick="add()"/>
</p> </p>
<p> <p>
<label for="answer">Merci d'indiquer votre email</label><br/> <label for="email">Merci d indiquer votre email</label><br/>
<input id="email" name="email" type="text" /> <input id="email" name="email" type="text" />
</p> </p>
<p> <p>

View File

@ -58,13 +58,11 @@ if (isset ($_POST['send']))
// Get an email from the list // Get an email from the list
echo 'Mail of user : ' . $_POST['email']; echo 'Mail of user : ' . $_POST['email'] . "<br/>";
$file = fopen('email.txt', 'r'); $file = fopen('email.txt', 'r');
$number = fgets($file); $number = fgets($file);
while (true)
{
$random = rand(1, $number); $random = rand(1, $number);
for ($i = 0; $i < $random; $i++) for ($i = 0; $i < $random; $i++)
@ -72,12 +70,7 @@ if (isset ($_POST['send']))
$line = fgets($file); $line = fgets($file);
} }
if ($line != ($_POST['email']) echo 'Adresse mail: ' . $line . "<br/>";
{
break;
}
}
echo 'Adresse mail: ' . $line;
fclose($file); fclose($file);
/* This code works, perhaps should be placed in a method in Question class? /* This code works, perhaps should be placed in a method in Question class?