I am just trying to print the emails to test it ......
You made the checkboxes form, with the categires:
That might looks like this:
<?
print "<table border=\"1\"><tr> ";
print "<td>group_name</td>";
print "<td>Get email from this</td>";
print "</tr>";
include("connect.php");
$parancs="SELECT * FROM groups_email";
$eredmeny=mysql_query("$parancs");
print '<form action="checked_groups.php" method="post" name="email_cat">';
while( $egy_sor = mysql_fetch_object( $eredmeny))
{
print "<tr>";
print "<td>$egy_sor->group_name</td>";
print '<td> <input type="checkbox" name="checkbox[]" value="'.$egy_sor->id.'"> </td>';
print "</tr>";
}
print "</table>";
print ' <input type="submit" name="Submit" value="Submit">
</form>';
?>
And you have the checked_groups.php, in that you list the categories like this:
<?
if($_POST)
{
foreach($_POST["checkbox"] AS $values)
{
print $values."<br>"; // <<<------- this is the category id you must select from the information table...
$values=mysql_real_escape_string($values);
$parancs2="SELECT * FROM `information_email` WHERE group_id=$values";
$eredmeny2=mysql_query("$parancs2");
while( $egy_sor2 = mysql_fetch_object( $eredmeny2))
{
$email[]=$egy_sor2->information_message_email;
}
}
/*and now you have the $email[] array, stored all the email contact for the categories...
let's print the $email[] array, but it might has duplications, if you know that values is uqique, use the foreach.*/
if($email[0])
{
foreach($email as $var=>$val)
{
print $val." is a selected email address<br>";
}
}
else
print "Email array is empty";
}
?>
And now, what's going on with these emails? if it is a registered user, you can download his email address, and send the categories links...
And soo on.
bye
jjozsi