Thank you Brian for all your hard work.
Brian,
I have just one question…
On the second video where you create a session variable, if I were to unhide the input field which is set to have the value of that variable, should I see the variable string?
CK
Yes, if you change the input type to text you should see any content
Thought so…
In my case I don’t see any content. I have checked the new server action which generates the session and it looks correct.
As a test I added a set value using the UUID and I can see that value on my contact page but not the session.
When @Teodor did his version he created the session variable directly on the page via hand coded PHP, in that instance I was able to see the session variable in the input field.
I’m not sure whats going on as there no errors in the browser inspector either.
CK
Yes but that was PHP, this is Node
did you remember to check the output icon for the set session step?
If that doesn’t fix it then run your API action directly form the workflows panel
You should see the UUID output
Assuming you are using PHP (as your issue would be what PHP would do) we have a simple workaround. The problem is when using the PHP model the output option for set session does not actually do anything (been like that since day one, never fixed)
So for PHP 2 changes are needed
Firstly define the session variable in global
Add a second stage to the API action. a “set value”, also call it codegen
Assign it the value of the session via the picker, selection $_SESSION.codegen and check output
That should enable an output
A short video re extra steps required for PHP added
Thank you so much Brian for your extra video and the explanation above, solutions works like a charm.
I look forward to seeing your future tutorials which really show in a real life enviorment what wapper can do!
CK
One point I would like to make regarding the two hidden input fields created in order to implement Brian’s ‘Honey Pot’ solution.
Rather than use hidden fields you can use ‘d-none’ if using Bootstrap 4 or above, this renders the fields hidden but doesn’t let any smart spam-bot ignore a hidden field tag.
I just went through this one today @Hyperbytes , seems to work just great, thanks for taking the time to make it.
Will Wapplers ‘visually hidden’ check box not achieve the same…?
Hello, I must say I didn’t go through all responses, but for what it’s worth, a way I’ve found to prevent spam on contact forms (at least to block lots of automated submissions) is to put your app (wappler or not) behind Cloudflare.
It is not a perfect solution, but it helps a lot.