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()"/>
</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" />
</p>
<p>

View File

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