Help, I'm a php rookie. I have a functioning form to email script, but I can't seem to get it to display checked checkboxes. I am grateful for help on this!
Here's the checkbox (three checkboxes) and submit portion of my html form:
<label>Check all that apply: </label>
<p><input type="checkbox" name="checkbox1" value="mammography"> I want to receive medical updates about mammography</input></p>
<p><input type="checkbox" name="checkbox2" value="blog"> Keep me connected — tell me about Tom's current writing</input></p>
<p><input type="checkbox" name="checkbox3" value="book"> Notify me when Dr. Hudson's book is available</input></p>
<p> <strong>Click here to complete your request:</strong>
<input type="submit" value="Subscribe"/>
<br /></p>
And here's the php script. I have three checkboxes and I'd like the email to owner to display the corresponding message to the checked checkboxes here:
if(isset($_POST['checkbox1'])) {
echo '<p>Send me medical updates about mammography.</p>';
{echo '<input type="checkbox" name="checkbox1" checked="checked" value="YES">';
}
if(isset($_POST['checkbox2'])) {
echo '<p>Keep me connected with the latest blog posts.</p>';
echo '<input type="checkbox" name="checkbox1" checked="checked" value="YES">';
}
if(isset($_POST['checkbox3'])) {
echo '<p>Let me know when the book is available.</p>';
echo '<input type="checkbox" name="checkbox3" checked="checked" value="YES">';
}
if (isset($_POST['Submit1'])) {
}