Jump to content


Email form with checkboxes

  • Please log in to reply
1 reply to this topic

#1 tcwaage

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 March 2006 - 07:31 AM

I'm trying to make an email form where the addresses are stored in a database. I want to be able to display all the addresses at the top of a form and the user be able to check the people he/she wants to send a message to. I know how to display all the addresses, but how do I code it so that the scipt checks if a person is to receive the msg or not? I've attached the form code so you get sort of an idea of what it would look like.

<form id="form1" name="form1" method="post" action="">
<table width="500" border="0">
<td><input type="checkbox" name="checkbox" value="checkbox" />
Person 1 </td>
<td>Email address </td>
<td> <input type="checkbox" name="checkbox2" value="checkbox" />
Person 2 </td>
<td>Email address </td>
<td><input type="checkbox" name="checkbox3" value="checkbox" />
Person 3 </td>
<td>Email address </td>
<td><input type="text" name="textfield" /></td>
<td><input type="text" name="textfield2" /></td>
<td>Return Email address </td>
<td><input type="text" name="textfield3" /></td>
<td><textarea name="textarea" cols="30" rows="10"></textarea></td>
<td><div align="right">
<input type="reset" name="Submit2" value="Reset" />
<td><input type="submit" name="Submit" value="Submit" /></td>

#2 shortj75

  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts
  • LocationPort Huron,mi

Posted 27 March 2006 - 07:40 AM

try this

$getemail=mysql_query("select * from your_table");
echo "<input type=checkbox name=$getemail2[your_column]> $getemail2[your_column]";
that should display all the email addres in your database and set the value of the checkbox change your_table and your_column to the correct database names and you only need the one line of code and it will pull all of the email addresses
The Short One

hopfully this helps if it doesn't sorry
i won't write the code for you!!! you don't learn that way

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users