Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

    Default Re: get a quote page help

    Quote Originally Posted by davewest View Post
    Get a quote is a copy of contact us, use that form to correct issues with this one.. for FILENAME_DEFINE_GET_QUOTE is for the language page not the template page which is FILENAME_GET_QUOTE ...

    the email addresses used is the same one used for contact us! The quote page is very basic and a copy of the contact us,,
    Thanks, That helped me move another step forward. Now I'm getting a new error
    [06-Nov-2018 18:15:46 UTC] Request URI: /index.php?main_page=get_quote&action=send, IP address: 76.177.248.108
    #1 require(/home/myhomefolder/public_html/visionsinvinyldesigns.com/includes/modules/pages/get_quote/header_php.php) called at [/home/myhomefolder/public_html/visionsinvinyldesigns.com/index.php:36]

    [06-Nov-2018 18:15:46 UTC] PHP Warning: Illegal string offset 'txt_' in /home/myhomefolder/public_html/visionsinvinyldesigns.com/includes/modules/pages/get_quote/header_php.php on line 61
    [06-Nov-2018 18:15:46 UTC] Request URI: /index.php?main_page=get_quote&action=send, IP address: 76.177.248.108
    #1 require(/home/myhomefolder/public_html/visionsinvinyldesigns.com/includes/modules/pages/get_quote/header_php.php) called at [/home/myhomefolder/public_html/visionsinvinyldesigns.com/index.php:36]

    [06-Nov-2018 18:15:46 UTC] PHP Warning: Illegal string offset 'txt_' in /home/myhomefolder/public_html/visionsinvinyldesigns.com/includes/modules/pages/get_quote/header_php.php on line 61
    [06-Nov-2018 18:15:46 UTC] ERROR: Failed sending email to: "" <> with subject: "Website Inquiry from Visions in Vinyl Designs" (failed validation)
    header php for that is below. I know it has some extra items that are not in the contact us, going to do some cam paring between the two.
    Code:
    hp
    
    /**
     * Contact Us Page
     *
     * @package page
     * @copyright Copyright 2003-2013 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 GIT: $Id: Author: DrByte  Sun Feb 17 23:22:33 2013 -0500 Modified in v1.5.2 $
     */
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_GET_QUOTE');
    
    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']);
        $email_address = zen_db_prepare_input($_POST['email']);
        $enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));
        $antiSpam = isset($_POST['should_be_empty']) ? zen_db_prepare_input($_POST['should_be_empty']) : '';
        $zco_notifier->notify('NOTIFY_CONTACT_US_CAPTCHA_CHECK');
    
        $zc_validate_email = zen_validate_email($email_address);
    
        if ($zc_validate_email and ! empty($enquiry) and ! empty($name) && $error == FALSE) {
            // if anti-spam is not triggered, prepare and send email:
            if ($antiSpam != '') {
                $zco_notifier->notify('NOTIFY_SPAM_DETECTED_USING_CONTACT_US');
            } elseif ($antiSpam == '') {
    
                // 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_TEXT;
                    $customer_name = NOT_LOGGED_IN_TEXT;
                }
    
                // 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 = preg_replace("/>/", "", $send_email_array[0]);
                    $send_to_email = trim(preg_replace("/</", "", $send_to_email));
                    $send_to_name = trim(preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]));
                } else {  //otherwise default to EMAIL_FROM and store name
                    $send_to_email = trim(EMAIL_FROM);
                    $send_to_name = trim(STORE_NAME);
                }
    
                include(DIR_WS_CLASSES . 'upload.php');
                if (zen_not_null($_FILES['quote_file']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX]]) and ( $_FILES['quote_file']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX]] != 'none')) {
                    $get_quote_file = new upload('id');
                    $get_quote_file->set_destination(DIR_FS_UPLOADS);
                    $get_quote_file->set_output_messages('session');
                    if ($get_quote_file->parse(TEXT_PREFIX . $_POST[UPLOAD_PREFIX])) {
                        $products_image_extension = substr($get_quote_file->filename, strrpos($get_quote_file->filename, '.'));
                        if ($_SESSION['customer_id']) {
                            $db->Execute("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name) values('" . zen_session_id() . "', '" . $_SESSION['customer_id'] . "', '" . zen_db_input($get_quote_file->filename) . "')");
                        } else {
                            $db->Execute("insert into " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name) values('" . zen_session_id() . "', '" . zen_db_input($get_quote_file->filename) . "')");
                        }
                        $insert_id = $db->Insert_ID();
                        $real_ids[TEXT_PREFIX . $_POST[UPLOAD_PREFIX]] = $insert_id . ". " . $get_quote_file->filename;
                        $get_quote_file->set_filename("$insert_id" . $products_image_extension);
                        $get_quote_file->save();
                        $attach_file = $get_quote_file->filename();
                    }
                } else { // No file uploaded -- use previous value
                    $real_ids[TEXT_PREFIX . $_POST[UPLOAD_PREFIX]] = $_POST[TEXT_PREFIX . UPLOAD_PREFIX];
                }
                // 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_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_GET_QUOTE, 'action=success', 'SSL'));
        } 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
    
    
    if (ENABLE_SSL == 'true' && $request_type != 'SSL') {
        zen_redirect(zen_href_link(FILENAME_GET_QUOTE, '', 'SSL'));
    }
    
    // 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_address = $check_customer->fields['customers_email_address'];
        $name = $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
    }
    
    $send_to_array = array();
    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_GET_QUOTE, 'false');
    $breadcrumb->add(NAVBAR_TITLE);
    
    // This should be the last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_GET_QUOTE');

  2. #12
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: get a quote page help

    The warning messages at the top are related to the absence of verifying if the $_FILES['quote_file']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX]] is set before trying to use the variable and while using either a version of PHP 7.x or with strict mode enabled.

    The error/issue in this case though is because the template file has disabled the contact us dropdown list (with no substituted send_to field) or the fact that your Set "Contact Us" Email Dropdown List is not empty... As a result, no email address is created to fit into the $send_to_email address and that is why the error message at the bottom of that list occurs...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

    Default Re: get a quote page help

    Can someone throw me a few hints on what I need to change Not a code person but I want to learn. Will this error above be the reasion the email comes thru but without the attachment.

  4. #14
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: get a quote page help

    In my opinion I would drop this plug-in and look for the plug-in that allows you to add forms I can't remember what it's called but it's in the plug in section I use it quite often and it's pretty easy
    Website - Github. Like the ZCA Bootstrap 4 Template? Donations Welcome. Bootstrap Plugins?

  5. #15
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

    Default Re: get a quote page help

    What I need is where a customer can fill out name, email, a short msg and send me a file to get a quote on cutting vinyl decals.

  6. #16
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: get a quote page help

    Website - Github. Like the ZCA Bootstrap 4 Template? Donations Welcome. Bootstrap Plugins?

  7. #17
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: get a quote page help

    In the above pasted header_php.php file if you change:
    Code:
    if (CONTACT_US_LIST != '') {
    To:
    Code:
    if (false && CONTACT_US_LIST != '') {
    Then the error will not be generated, but the warnings may still be if a file is not uploaded.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #18
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

    Default Re: get a quote page help

    Do you know if I can add Google reCAPTCHA to the form?

  9. #19
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: get a quote page help

    Quote Originally Posted by cubmanky View Post
    Do you know if I can add Google reCAPTCHA to the form?
    Not sure I don't use it. I think it is very slow. I use a mathematical php script.

    Can see it here. I'll share code if interested. Just won't be able to post it tonight.

    http://raymondospizza . com/catering/

    Click the contact us link
    Website - Github. Like the ZCA Bootstrap 4 Template? Donations Welcome. Bootstrap Plugins?

  10. #20
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

    Default Re: get a quote page help

    Quote Originally Posted by rbarbour View Post
    Not sure I don't use it. I think it is very slow. I use a mathematical php script.

    Can see it here. I'll share code if interested. Just won't be able to post it tonight.

    http://raymondospizza . com/catering/

    Click the contact us link
    So how do you go about adding the php script in?

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Quote marks in EZ Pages get messed up
    By kehrli in forum General Questions
    Replies: 4
    Last Post: 26 Aug 2013, 04:16 PM
  2. Replies: 6
    Last Post: 7 Sep 2012, 07:44 AM
  3. Unable to get USPS to quote international shipping
    By elgrcg in forum General Questions
    Replies: 3
    Last Post: 13 Jan 2011, 12:41 AM
  4. UPS: Unable to get quote
    By bloodandguts in forum Addon Shipping Modules
    Replies: 13
    Last Post: 12 Nov 2008, 02:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR