1
BotScout Discussion / Re: Calling BotScout in a custom php Contact Form
« Last post by Mike on May 13, 2013, 03:32:12 pm »To work, the BotBuster code needs to be able to "see" the submitted form variables for the user's name, email address, and IP. In some cases you might need to build a little bit of code separate from the native code in order to expose these variables so the BotBuster code can make use of them.
In your form the code needs to placed such that it can determine if it's being submitted or not. The easiest way to do this might be to check to see if those vars were present or not.
In your form the code needs to placed such that it can determine if it's being submitted or not. The easiest way to do this might be to check to see if those vars were present or not.
Code: [Select]
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
//////////////////////////////////////////
// are we viewing the form or submitting it?
if ( !empty($_POST['request_ip']) && !empty($_POST['form_id']) && !empty($_POST['form_name']) ){
// submitting...
// at this point you'll need to alias the incoming vars to match the ones
// used in the botbuster code, or modify the the botbuster code directly.
// BotScout.com "BotBuster" check
include('/path/to/my/directory/BotScout.php');
}
//////////////////////////////////////////

Recent Posts