Hi Anne, I was starting to get spam from bots using the contact-us form in the mega menu. So I killed the form and went back to testing the honeypot... found that 40% of the time, the honeypot and other error checks worked and 60% of the time it skipped all checks and went for the send... not sure why! Refused to return back to any CAPTCHA, decided on studying honeypots more closely... After some more testing and changes, it's been live for a week now without any more attacks and no CAPTCHA eye tests. What I did, honeypot suggestions.. --Hide the style tag into css ID --added placeholder so if css fails, user doesn't enter anything --added second honeypot, which is a preview of the message before sending.. if the first honeypot fails, the form just does as expected and displays the success screen and moves on, no send, never gets to that part of the code. if it tests good, on to the main contact us page where all but the subject is filled in, letting the user pick a subject and hit send... the form behaves as expected at this point, all tests work at 100%. The message is sent after testing email for bad or block addresses. I did it by changing the action from 'send' to 'mega' so I can do a quick honeypot check and go to preview if it's good. Fourm post is acting up on me so can't show any code...
Looks like it's working today... OK, forms have been modified for usibility, (nija code) so some things going on not part of the honeypot so can't just post it all, would mess folks up... just posting the honeypot.
using ZenCart 1.5.1
in Mega Menu I changed the action...
Then added this just after the textarea fieldCode:<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=mega', $request_type), 'post', 'enctype="multipart/form-data"'); ?>
in my stylesheet.css file I addedCode:<?php echo zen_draw_input_field('should_be_empty', '', ' size="10" id="email-pot" placeholder="do not fill in!" autocomplete="off"'); ?> <?php echo zen_draw_hidden_field('subject', 'From MegaMenu', ' id="subject"'); ?>
then in the includes/modules/pages/contact_us/header_php.php I added this after the $error = false; lineCode:#email-pot {position:absolute; visibility:hidden; display:none;}
So if it's a bot, it just leaves to the success page, non-bot, loads the contact us page, fills in what it had, I use a subject dropdown so I need them to pick something. With the default form you could keep the subject field intact. Oh.. I also changed the words submit to preview on the button.Code:if (isset($_GET['action']) && ($_GET['action'] == 'mega')) { $antiSpam = isset($_POST['should_be_empty']) ? zen_db_prepare_input($_POST['should_be_empty']) : ''; if ($antiSpam != '') { $zco_notifier->notify('NOTIFY_SPAM_DETECTED_USING_CONTACT_US'); zen_redirect(zen_href_link(FILENAME_CONTACT_US, 'action=success')); } elseif ($antiSpam == '') { $name = zen_db_prepare_input($_POST['contactname']); $email_address = zen_db_prepare_input($_POST['email']); $subject = ''; //blank subject so dropdown error works $enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry'])); } //fall back and fill in contact us form for final review and send }
So far it's working, and coming in using the contact from is normal, the honeypot is part of ZenCart 1.5.1..
Dave
Always forward thinking... Lost my mind!
Accidentally posted the following to the non-responsive version of this template and received a partial response (that needed to be implemented); however, the below issue/question is a bit different than previous discussion about the description not showing up (solution provided at: http://www.zen-cart.com/showthread.p...52#post1220352 ) which for me meant changing the last line of the css file.
Hi,
I've installed this template, been able to control the contact_us menu option so that do not get spam through it, moved some things around and clean it up so that features are enabled/disabled as set in the admin panel (version 1.5.1 of Zen Cart); however, I am trying to figure out where/how to disable the Details drop down if there is nothing in the database that would populate that drop down. (ie., on page loads where data is present to have it load/display, and on pages where nothing would be present to remove the "window" and any clickable areas.) I would also like to apply the CSS necessary to have the full description show on page load instead of the default of it being drawn up into the description button. (Ie., not require clicking on the description button to have the description appear.)
The problem is that the words "details" and "description" are throughout the ZC code so when searching for these particular program areas, I have not had much success and I am trying to get through this portion as quickly as I can. Could someone please direct me to which file(s) to look in for the programming code, and in which of the CSS files it would be recommended to add the line that will make the description show upon loading the page similar to having the special products, new products, and/or featured products show on the main page?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks