Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 ] Page 1 of 2 |
|
|||||
|
I used the java and example that was given and have a working contact form on my site. Only issue is I am getting 3-5 spam email via the form daily. Any suggestions on how to fix this or add a captcha of some sort. Anything to slow down the spam bots? Thanks, Rob |
||||
|
You could probably add a nother field to the form. Name that field "verification", and tell your users to type a specific word into it. Let it be "foobar" in this example. So in your code, you now only need to check for this field to be foobar: $text = ""; |
||||
|
Hi Niko, So is that the only code I need and just replace the current one? Sorry I only got the form working by following the step by step on the RC area. R. |
||||
|
Yes, that's all the code. But don't forget to add a third field to your form (like you added a filed for the text and for the email address) and set its name in the property window to "verification" |
||||
|
In the code where do I enter the word "foobar" as the word it will check? I made the text edit field and gave it a name of verification already. Not working when I upload since I think I am not clear where to put 'foobar" in the code. |
||||
|
Oh, I had mistyped the code above, now it is corrected (I had written "verification" instead of "foobar") now it should be more clear :) |
||||
|
when i upload the page with that code I get an error trying to goto it. I had to switch it back to the old page so it works. HTTP 500 error That’s odd... the website can’t display this page The site may be under maintenance or could have a programming error. Try this Go back to the last page Try contacting the website’s owner |
||||
|
Try pasting without those tabs. You probably have a syntax error in your php. You just don't see them because your web server is configurated not to show them. It is probably easier to enable them and see what the exact error is (so I'm just guessing). Try with this: $text = ""; |
||||
|
So from what I can tell using a PHP tester online. The error seems to be in the following code: if ($text != "" && _$POST["verification"] != "foobar") The online tester says the following: FATAL ERROR syntax error, unexpected '$POST' (T_VARIABLE) |
||||
|
Ah, you are right, sorry. There was a typo. I fixed that code, now it works. |
||||
|
I get the following message "Please enter the verification field correctly." before I even enter anything into the fields Here take a look: http://axmicro.com/contact.php |
||||
|
I assumed you wanted this on a target page only. I've updated the code to make it work both on the same as on the target page. |
||||
|
Now the error is gone but we are now back to being able to send a message without having to enter the word foobar. I was able to send a message without the verification entered and it sent??? |
||||
|
You are right. Sorry. Updated the code again. Next time I'll check this before posting. |
||||
|
Works perfect. Thank you so much. |
[ 1 2 ] Page 1 of 2 |
|