close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

creating a honepot

Thread began 11/25/2015 8:17 am by Jamie | Last modified 1/05/2017 11:22 am by Ray Borduin | 883 views | 13 replies |

Jamie

creating a honepot

Hey Ray

Just wondering what I could use in the server validations tool kit to create a hidden element that if has content added stops the form from being submitted (a honeypot). Obviously there is the require/not blank option but wondering if its possible to do the opposite of that to only allow submission if the field is empty?

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

You can do a "Like Entry" validation and leave the same as field blank.

Sign in to reply to this post

Jamie

Thanks Ray

Have added <input name="pot" type="text" value="" style=" visibility:hidden;"> just inside the opening <form> and then added the server validation

<?php 
if ((isset($_POST["PatientQuestionnaire_submit"]) || isset($_POST["PatientQuestionnaire_submit_x"]))) {
$WAFV_Redirect = "".(htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)) ."?invalid=true";
$_SESSION['WAVT_contact_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ((isset($_POST["Name"])?$_POST["Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateRQ((isset($_POST["Telephone"])?$_POST["Telephone"]:"") . "",true,2);
$WAFV_Errors .= WAValidateEM((isset($_POST["Email_Address"])?$_POST["Email_Address"]:"") . "",true,3);
$WAFV_Errors .= WAValidateLE(((isset($_POST["pot"]))?$_POST["pot"]:"") . "", . "",true,4);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}
}
?>



but for some reason the addition of the server validation is causing the page to error - just a blank screen

As soon as I remove

$WAFV_Errors .= WAValidateLE(((isset($_POST["pot"]))?$_POST["pot"]:"") . "", . "",true,4);

the page renders fine....

Sign in to reply to this post

Ray BorduinWebAssist

It should be:
$WAFV_Errors .= WAValidateLE(((isset($_POST["pot"]))?$_POST["pot"]:"") . "", "" . "",true,4);

It appears you have to actually enter: ""

when adding the compare to value.

Sign in to reply to this post

Jamie

oh perfect... thanks mate.

I have tried testing it and the only way I figured I could do that is to change <input name="pot" type="text" value="" style=" visibility:hidden;"> to <input name="pot" type="text" value="some content" style=" visibility:hidden;"> but whether it is the former or the latter, the form still submits... have attached the page

p.s. hope you had a great Thanksgiving

Sign in to reply to this post

Ray BorduinWebAssist

Where did you add the honeypot hidden field? Can I see that page?

Sign in to reply to this post

Jamie

It's on that page attached to post #5 and is located just inside the opening <form> tag

Sign in to reply to this post

Ray BorduinWebAssist

Your submit button is named: Submit, but the server validation triggers off a form button named: PatientQuestionnaire_submit

You'll either have to update the form button name or trigger to match... currently no server validation is running at all.

Sign in to reply to this post

Jamie

Gotcha... ok made that correction but now it wont submit at all whether there is a value in the hidden field or if its empty...

Sign in to reply to this post

Ray BorduinWebAssist

Use:
$WAFV_Errors .= WAValidateLE(((isset($_POST["pot"]))?$_POST["pot"]:"") . "","" . "",false,2);

the final argument sets whether it is required or not... it won't accept blank values with it set to true.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...