[SOLVED] bcc if checkbox is checked

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
boxkites
Forum Newbie
Posts: 4
Joined: Sat Jul 24, 2004 8:43 am
Location: New Zealand

Post by boxkites »

Hallo.
I am fairly new to this and have read a few post relating to my question first. I do not know if the information in this post is suitable for my intended purposes. Perhaps it could be tweeked a bit to suit.

I would like to have a check button on my contact form that lets visitors have the option to send themselves a copy of the contact email.
I know this can be done without the option by using bcc. But I have no idea how to make the checkbox send an copy when checked or not send when unchecked.
Can anybody help me please?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Moderatorial: Please try to keep one topic in a thread. Don't hijack others' threads
lolpix
Forum Commoner
Posts: 41
Joined: Sat Jul 17, 2004 2:20 am

Post by lolpix »

You could do some thing like...

mail(mail message to site owner);

if ($bcc == TRUE) mail(mail copy of message to author);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

following lolpix's idea a little, you could check against the checkbox being selected. When selected, you can simply add a Bcc to the header component of the mail call which should take care of it.
User avatar
boxkites
Forum Newbie
Posts: 4
Joined: Sat Jul 24, 2004 8:43 am
Location: New Zealand

Post by boxkites »

Hi All
Thanks for the info. I have got it working just fine thanks to you guys.
Post Reply