Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all, I have a problem concer

Status
Not open for further replies.

kusarigama

Technical User
Apr 24, 2002
45
0
0
DE
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&quot;<input type=checkbox name=emails[] value=&quot;.$i.&quot;>&quot;.$emails.&quot;<br>&quot;;
$i++;

}
fclose($fp);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top