close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Contact Form Server Validation To Block IP Address

Thread began 12/03/2011 9:38 am by dlovas275157 | Last modified 4/23/2013 4:47 am by this_is_me | 3072 views | 4 replies |

dlovas275157

Contact Form Server Validation To Block IP Address

I would like to add a WA Server Validation Rule to block a form from being submitted from certain IP Addresses. A client is getting spammed not by bots but by a group of people actually filling out the form. I already have a captcha and honeypot working and other Server Validations.

How would i construct the rule to not send if the ip is equal to one of the following multiple ip's:
115.119.131.226
124.253.13.206
87.54.37.139

Ideally, I'd like to structure the validation to be able to add additional ips easily.

Sign in to reply to this post

Jason ByrnesWebAssist

to make it easier to maintain, I would hand code this.

add the following code at line 1 of your for page:

php:
<?php

$banned 
= array();
$banned[] = "115.119.131.226";
$banned[] = "124.253.13.206";
$banned[] = "87.54.37.139";

if (
in_array ($_SERVER['REMOTE_ADDR'], $banned)) {
   
header("location: http://www.google.com/");
   exit();

?>



you can easily add a new IP to the array of banned IP addresses.

Sign in to reply to this post

dlovas275157

I added a Server Validation structured as:

Any Form Post (the contact form on my page)
Restrict Content
Server Variable: ((isset($_SERVER["REMOTE_ADDR"]))?$_SERVER["REMOTE_ADDR"]:"")
Don't Allow "115.119.131.226" exact
Don't Allow "124.253.13.206" exact
...etc listing all offending IPs.

This seems to have worked so far.

I will keep your code as well for this project and another that is getting hit with spam quite a lot.

Thank you.

Sign in to reply to this post

this_is_me

Thank you

great help, thank you!

Sign in to reply to this post

dlovas275157

Did this get resolved? I have the same issue?

This post has been deleted.

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...