kusarigama
Technical User
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 $_POST['emails'] is totally empty. Register globals are on and I'm using PHP 4.22
Can anyone help me or fix (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);
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 $_POST['emails'] is totally empty. Register globals are on and I'm using PHP 4.22
Can anyone help me or fix (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);