thatryan Posted August 22, 2008 Share Posted August 22, 2008 Greetings, I have a MySQL database where I am storing some basic info, one thing is an email address. This is for my forum for church and I want to give the option to search for members, (based on another personality traits form I made) and have it return the email address, but hidden, so I just put like a checkbox next to each name. That way you check the results whom you want to email, click submit and that sends all needed stuff to a mail form, where the $to will be populated with the email addresses. My problem is I am VERY new to all this, and I dont know how to store the emails as they come back form SQL and then how to send them to the form. I am inserting relevant snippets of what I have tried so far, but I keep getting PHP error that I can't read from []. I would appreciate any help, I am out of ideas. THank you for reading! This is my page that displays the search results; $email = 0; echo'<form action="forumMail.php">'; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['ministry1'] . "</td>"; echo "<td>" . $row['ministry2'] . "</td>"; echo "<td>" . $row['personality1'] . "</td>"; echo "<td>" . $row['personality2'] . "</td>"; $emails[] = $row['email']; if($emails[$email]) { $email++; echo'<td> email? <input type="checkbox" name="mail[]" value="<?php $row[email]?>"> </td>'; } echo '</tr>'; } echo' <br> <table border="0"> <tr> <td> <input type="submit" value="Submit"> </td> </tr> </form>'; this is a part of the form that submit invokes, { foreach($POST_emails[] as $input) { $to = $input . ',' .""; } Quote Link to comment https://forums.phpfreaks.com/topic/120903-trying-to-mass-email-with-hidden-address-help-please/ Share on other sites More sharing options...
thatryan Posted August 22, 2008 Author Share Posted August 22, 2008 Wow page two already? bump. Any ideas? I have been stuck for days. Quote Link to comment https://forums.phpfreaks.com/topic/120903-trying-to-mass-email-with-hidden-address-help-please/#findComment-623427 Share on other sites More sharing options...
DeanWhitehouse Posted August 23, 2008 Share Posted August 23, 2008 only glanced, but this looks wrong if($emails[$email]) , as $email is a undefined var, try defining it first. Quote Link to comment https://forums.phpfreaks.com/topic/120903-trying-to-mass-email-with-hidden-address-help-please/#findComment-623487 Share on other sites More sharing options...
thatryan Posted August 23, 2008 Author Share Posted August 23, 2008 Can I do something like this? while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['ministry1'] . "</td>"; echo "<td>" . $row['ministry2'] . "</td>"; echo "<td>" . $row['personality1'] . "</td>"; echo "<td>" . $row['personality2'] . "</td>"; $addresses = $row['email'] . ','; . . . then just past $address to the mail form in POST and use it as the $to? Quote Link to comment https://forums.phpfreaks.com/topic/120903-trying-to-mass-email-with-hidden-address-help-please/#findComment-623857 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.