Hi all,
In my addmail.php, I have the code for renaming an E-mail in my textfile. You click the desired checkbox and enter the new E-mail in the textfield. My problem now is, that everytime I rename an E-Mail, the New line will be droped, next to the email.
I also have problems with checking how many checkboxes are selected. "if (isset($POST['selmail[$j]'] < 1)) ". It doesn't work.
Can anyone help me , please ?
Olli
here's the code:
The Textfile:
test@test.com
hello@hello.com
This is mailreader.php
<?PHP
$reader = "emails.txt";
$mails = file($reader);
for($i=0; $i<count($mails); $i++)
{
print "<input type=checkbox name=semails[$i] value=>$mails[$i]"."<br>";
}
This is _addmail.php
include ("_mailreader.php");
$read = file_get_contents($reader);
if(isset($POST['addmailtolist'])) // the submit button
{
if (isset($POST['selmail'[$j]'] < 1)) // only 1 box should be selected
{
if(empty($POST['addmail'])) // the textfield
{
$add =$read .$POST['addmail']."\n";
$fp = fopen($reader, "w+");
fwrite($fp, $add);
fclose($fp);
}
}
}