Copy_to_me - Checkbox

kuzco

Avatar: kuzco

2011-02-20 21:35

Hi,
have created in pages_default.tpl a contact form with a checkbox "Copy mail to me".

<dd class="descr">
<input type="checkbox" class="checkbox" checked="checked" value="1" name="mailback">$lang['Copy_to_me']
</dd>

In common.php I am using a function mail to send the info to me. Evyerthing is working fine, except of the checkbox verification. I want to check in common.php if the checkobx is checked or not in the contact form.

Have tried:
If ($_POST[mailback] == "on") {
// checkbox checked
@mail( $sSender, $sTopic, $sMailContent, 'From: '.$sSender); /* Mail to customer */
}
else {
// checkbox empty
}

Unfortunately tis does not work.

Any hint is weclome.

» Quick.Cart v3.x

Kobejasi

Avatar: Kobejasi

2011-02-20 21:51

try this:

If ($_POST[mailback] == 1 )

or change:

<input type="checkbox" class="checkbox" checked="checked" value="on" name="mailback">$lang['Copy_to_me']

variable must be the same in form and in the script

http://www.walendowski.com

boboo

Avatar: boboo

2011-02-20 22:00

It is very interesting,
a year ago I've created a contact form with the SAME variable names.
But, in the first line it is enough to write:
if(isset($_POST['mailback'])){
...
and in the header part 'From:' I would set my own e-mail address. So the customer can see where from the e-mail came. In your case he will see himself as sender.
Exchange $sSender
with
$GLOBALS['config']['orders_email']

http://it-service.kimla.de

kuzco

Avatar: kuzco

2011-02-21 09:54

Cool, it is working now.
Many thanks.

@boboo: That is really interesting, but MAILBACK was my first idea.

Back to top
about us | contact