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

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

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?