Totally Zenned
- Join Date:
- Jan 2007
- Location:
- Los Angeles, California, United States
- Posts:
- 10,011
- Plugin Contributions:
- 3
Simple CSS/PHP AntiSpam solution for a contact form
<!-- NOSPAM --> <input style="visibility:hidden; display:none;" name="leaveblank" type="text"> <br class="clearBoth" /> <!-- NO SPAM --> ``` > > What does it do, other than create a hidden text field? With this added I have TWO hidden text fields. I have tested the form with both leaving this blank or filled in, and it seems to have no effect?... It is the text input field that is created with ``` <?php // BOF insert for anti-spam-login ?> <input style="visibility:hidden; display:none;" name="leaveblank" type="text"> <?php // EOF insert for anti-spam-login ?> ``` That sends the user to the index page when filled in. > > Is it safe to not include ``` <!-- NOSPAM --> <input style="visibility:hidden; display:none;" name="leaveblank" type="text"> <br class="clearBoth" /> <!-- NO SPAM --> ``` > -------------------------------------- > > I ask as your technical knowledge is far greater than mine and your input highly appreciated.ray-the-otter:
Hi Diva, May I trouble you for some assistance in packaging this up into a downloadable addon?
It is regards the Create Account Section
When I disable CSS and complete all fields, rather than getting a "When you hit send, you should be redirected to the session timed out page." I am returned to the index page. I get no error logs in my CACHE folder and the account is NOT created. So is this the correct action?
in includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
I have no greater technical knowledge persay. I just read a lot and test a lot..:yes: to answer your question, I have not used WhitePhoenix's code and only reviewed it to ensure that it did not include errors previously posted and to correct file paths and other issues I found with code posted in this thread. That said in really looking it over that code, I see it does indeed add TWO hidden fields.. I suspect that WhitePhoenix was not even aware of this and simply just following instructions found on the web or this thread. In any case you certainly don't NEED two hidden fields for this solution to work. One will do.. Eliminate whichever one you like..
As for the redirect: Sorry about that.. again I was reviewing the code WhitePhoenix posted for obvious errors when I re-posted it, and I missed that.. If you look at the code that the Create Account form uses for the re-direct, "FILENAME_DEFAULT" is the constant for the home page
// BOF CSS_ANTI_SPAM
if (!empty($leaveblank)) {
zen_redirect(zen_href_link(FILENAME_DEFAULT));
}
// EOF CSS_ANTI_SPAM
If you want it to re-direct the same way the Contact Us for does (to a "timed out" page), then use this code instead.
//NO SPAM
if (!empty($leaveblank)) {
zen_redirect(zen_href_link(FILENAME_TIME_OUT, 'action=success'));
}
//NO SPAM
DrByte:
It's built-in to the core files (not addons) of the next release of Zen Cart.Awesome!! It's such a simple and cool solution.. I have the same question ray posed, is this gonna be in a upcoming 1.5.x release??
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.