Hi all,
I have a problem concerning the $POST array. In my script I display checkboxes as much emails my textfiles contains.
It's normaly stored in the $POST array. Now I make a mark on the email's checkboxes to output - and it doesn't work. The array is totally empty. Register globals are on and I'm using PHP 4.22
Can anyone help me or fix or correct my script ? 😉
Here's the code:
$reader= "emails.txt";
$fp = fopen($reader,"r");
if(isset($POST['email_sel']))
{
for($i=0; !feof($fp); $i++)
{
$emails = chop(fgets($fp,260));
if(empty($emails))
{
continue;
}
if (in_array($i, $POST['emails']))
{
echo $emails;
}
}
}
$i=0;
while(!feof($fp))
{
$emails = chop(fgets($fp,260));
if(empty($emails))
{
continue;
}
print"<input type=checkbox name=emails[] value=".$i.">".$emails."<br>";
$i++;
}
fclose($fp);