Forums / Basic Configuration / Results from contact-form

Results from contact-form

Locked

Views: 2,559

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
8 Aug 2006, 6:44 PM
#1
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Results from contact-form

I would like the results from the contact-form emailed to a certain email-address (a @gmail.com address). Can I just add a *$recipient="[email protected]"; *somewhere? If so, where do I add this?

If this is not the way to go, then what is?

8 Aug 2006, 6:51 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Results from contact-form

In your browser look in
admin-> configuration -> email settings

Zen cart PCI compliant Hosting

8 Aug 2006, 7:03 PM
#3
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

Thank you for your quick response. If you mean E-mail Options, I've already tried this.

These are my settins there (this is for a different email-account):

Is there anything wrong here? With these settings I do not receive the results of the contact-form.

8 Aug 2006, 7:08 PM
#4
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Results from contact-form

it should be
Name < email address>, and you can put more than one email address there

Zen cart PCI compliant Hosting

8 Aug 2006, 7:22 PM
#5
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

I have changes every email-address in E-mail Options from *[email protected] *to Wendy [email protected], but still nothing.

Also, shouldn't there be a Success page (something like; the form has been sent). Whenever I click Send it just sends me back to the home page. The URL then looks like this:

http://www.visionelectronics.nl/index.php?main_page=contact&action=send

8 Aug 2006, 7:39 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Results from contact-form

The successful send should go to:
/index.php?main_page=contact_us&action=success

With a successful send message on the page ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Aug 2006, 7:41 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Results from contact-form

Your's appears to go to:
/index.php?main_page=contact&action=send

Did you change something on this to go to a different page?

I cannot read your page to know what it is saying ... :cry:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Aug 2006, 7:49 PM
#8
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

My Send-button does take me to /index.php?main_page=contact&action=send.

To my knowledge I didn't change anything to indicate it should go there instead of to /index.php?main_page=contact&action=success.

Which php-file should I check to change this?

8 Aug 2006, 7:51 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Results from contact-form

I am not sure as Zen Cart goes to the contact_us and not something called contact ... so it makes me think something has changed, but that could be caused by a lot of things ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Aug 2006, 1:13 AM
#10
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Results from contact-form

this should go to
/index.php?main_page=contact&action=success

Zen cart PCI compliant Hosting

9 Aug 2006, 4:10 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Results from contact-form

Let's start at the beginning:

wendydej:

I would like the results from the contact-form emailed to a certain email-address (a @gmail.com address).

Why?

You went on to give an example showing multiple email addresses.

Are you saying you want the results to go to two places ?

Or are you only saying that your contact-us emails aren't being delivered?

Or do they get delivered fine for a non-Gmail address but fail when sending to gMail accounts?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Aug 2006, 11:07 AM
#12
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

Yes, thank you Merlinpa1969, Ajeh already established this.

The question; which php-file do I have to change?

DrByte; I'm saying that nothing gets delivered anywhere, whether it's a @gmail account of any other account. We've already established that it apparently has something to do with the fact that my Send button sends me to /index.php?main_page=contact&action=send while it should be /index.php?main_page=contact&action=success. So how do I solve this?

9 Aug 2006, 11:35 AM
#13
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

After some searching, I found the file /includes/modules/pages/contact_us/header_php.php. I think this might be the file in which to indicatie the whole send/success business. I'll post it here, maybe someone can tell me where the problem might be. I have edited this before in order to add more fields.

<?php
/**
 * Contact Us Page
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $
 */
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
  $name = zen_db_prepare_input($_POST['contactname']);
  $adres = zen_db_prepare_input($_POST['adres']);
  $woonplaats = zen_db_prepare_input($_POST['woonplaats']);
  $telnummer = zen_db_prepare_input($_POST['telnummer']);
  $email_address = zen_db_prepare_input($_POST['email']);
  $enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));

  $zc_validate_email = zen_validate_email($email_address);

  if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
    // auto complete when logged in
    if($_SESSION['customer_id']) {
      $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = :customersID";
      
      $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
      $check_customer = $db->Execute($sql);
      $customer_email= $check_customer->fields['customers_email_address'];
      $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
    } else {
      $customer_email='Not logged in';
      $customer_name='Not logged in';
    }

    // use contact us dropdown if defined
    if (CONTACT_US_LIST !=''){
      $send_to_array=explode("," ,CONTACT_US_LIST);
      preg_match('/\<[^>]+\>/', $send_to_array[$_POST['send_to']], $send_email_array);
      $send_to_email= eregi_replace (">", "", $send_email_array[0]);
      $send_to_email= eregi_replace ("<", "", $send_to_email);
      $send_to_name = preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]);
    } else {  //otherwise default to EMAIL_FROM and store name
    $send_to_email = EMAIL_FROM;
    $send_to_name =  STORE_NAME;
    }

    // Prepare extra-info details
    $extra_info = email_collect_extra_info($name, $email_address, $customer_name, $customer_email);
    // Prepare Text-only portion of message
    $text_message = OFFICE_FROM . "\t" . $name . "\n" .
    OFFICE_ADRES . "\t" . $adres . "\n" .
    OFFICE_WOONPLAATS . "\t" . $woonplaats . "\n" .
    OFFICE_TELNUMMER . "\t" . $telnummer . "\n" .
    OFFICE_EMAIL . "\t" . $email_address . "\n\n" .
    '------------------------------------------------------' . "\n\n" .
    strip_tags($_POST['enquiry']) .  "\n\n" .
    '------------------------------------------------------' . "\n\n" .
    $extra_info['TEXT'];
    // Prepare HTML-portion of message
    $html_msg['EMAIL_MESSAGE_HTML'] = strip_tags($_POST['enquiry']);
    $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM . ' ' . $name . '<br />' . OFFICE_EMAIL . '(' . $email_address . ')';
    $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
    // Send message
    zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us');

    zen_redirect(zen_href_link(FILENAME_CONTACT_US, 'action=success'));
  } else {
    $error = true;
    if (empty($name)) {
      $messageStack->add('contact', ENTRY_EMAIL_NAME_CHECK_ERROR);
    }
    if ($zc_validate_email == false) {
      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }
    if (empty($enquiry)) {
      $messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR);
    }
  }
} // end action==send

// default email and name if customer is logged in
if($_SESSION['customer_id']) {
  $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
          FROM " . TABLE_CUSTOMERS . " 
          WHERE customers_id = :customersID";
  
  $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
  $check_customer = $db->Execute($sql);
  $email= $check_customer->fields['customers_email_address'];
  $name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
}

if (CONTACT_US_LIST !=''){
  foreach(explode(",", CONTACT_US_LIST) as $k => $v) {
    $send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
  }
}

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_CONTACT_US, 'false');

$breadcrumb->add(NAVBAR_TITLE);
?>
9 Aug 2006, 5:29 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Results from contact-form

wendydej:

I have edited this before in order to add more fields.
If you put back the original file, does it work properly?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Aug 2006, 5:32 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Results from contact-form

Your changes to the header_php.php file appear to be fine.

You likely also made changes to the tpl_contact_us_default.php file. What are the contents of your customized file?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Aug 2006, 5:47 PM
#16
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

My tpl_contact_us_default.php looks liks this:

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=contact_us.<br />
 * Displays contact us page form.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_contact_us_default.php 3230 2006-03-20 23:21:29Z drbyte $
 */
?>
<div class="centerColumn" id="contactUs">

<?php echo zen_draw_form('contact_us', zen_href_link('contact', 'action=send')); ?>

<?php
  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>

<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

<?php
  } else {
?>

<?php if (DEFINE_CONTACT_US_STATUS == '1') { ?>
<div id="contactUsNoticeContent" class="content">
<?php
/**
 * require html_define for the contact_us page
 */
  require($define_page);
?>
</div>
<?php } ?>

<?php if ($messageStack->size('contact') > 0) echo $messageStack->output('contact'); ?>

<fieldset id="contactUsForm">
<legend><?php echo HEADING_TITLE; ?></legend>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />

<?php
// show dropdown if set
    if (CONTACT_US_LIST !=''){
?>
<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
<?php echo zen_draw_pull_down_menu('send_to',  $send_to_array, 'id=\"send-to\"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<?php
    }
?>

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="adres"><?php echo ENTRY_ADRES; ?></label>
<?php echo zen_draw_input_field('adres', $name, ' size="40" id="adres"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="woonplaats"><?php echo ENTRY_WOONPLAATS; ?></label>
<?php echo zen_draw_input_field('woonplaats', $name, ' size="40" id="woonplaats"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="telnummer"><?php echo ENTRY_TELNUMMER; ?></label>
<?php echo zen_draw_input_field('telnummer', $name, ' size="40" id="telnummer"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($error ? $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label for="enquiry"><?php echo ENTRY_ENQUIRY . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', '', 'id="enquiry"'); ?>

</fieldset>

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<?php
  }
?>
</form>
</div>
10 Aug 2006, 7:26 AM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Results from contact-form

Your template is using:```php

<?php echo zen_draw_form('contact_us', zen_href_link('contact', 'action=send')); ?>

instead of the usualphp

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

Thus, you are sending the form to the non-existent "contact" page, which has no intelligence (because it doesn't exist) on how to process the form.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Aug 2006, 7:43 AM
#18
wendydej avatar

wendydej

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: Results from contact-form

DrByte; thank you soooooooooo much! This worked great! Now I get a success-page and almost immediately I got the message in my mailbox.

Thank you!!!!!:laugh:

10 Aug 2006, 8:53 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Results from contact-form

it's amazing what weird things happen when you break pattern while making customizations !

Glad it's working again.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.