FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CloudFlare: Getting original IP address of the visitor
#1
Hello!

I have a suggestion, if it is possible.

Do you know CloudFlare? It's an amazing service for making your websites faster and more secure. I have been using their free service for a while, and I'm really happy.

The problem is that when I try to use CloudFlare with a domain that hosts a FormTools form, which is getting the original IP of visitor, what happens is that always arrives the CloudFlare IP and there is no way to obtain the original one.

After asking CloudFlare support, making the change in VPS and dedicated is easy, but in a shared environment, some changes must be done.

Feel free to check this wiki document:

http://www.cloudflare.com/wiki/Log_Files

Hope there is an easy workaround for this. Thank you!!
For example, there is a Wordpress module:

http://wordpress.org/extend/plugins/cloudflare/
Reply
#2
We also use CloudFlare and also have this problem.

- Mark
Reply
#3
Hey guys,

Huh, I'd never heard of CloudFare. Interesting service.

I guess the Apache re-write option they suggest isn't possible in your cases? I'll take a look at one of the PHP app code to see what they're doing to extract the correct IP. If it's not too difficult, maybe I could put something together.

- Ben
Reply
#4
Hey guys,

Mind trying a quick thing?

Add this line to your config.php file:

PHP Code:
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"]; 

From what I've *read*, Cloudflare passes the original users' IP address via the HTTP_CF_CONNECTING_IP header, so that should fix it for Form Tools.

That said, I quickly tried setting it up on one of my own domains and didn't see the header that I expected.

Still, give it a go and let me know. It won't cause any problems if it doesn't work.

- Ben

Reply
#5
You may look at more detail instruction here http://wp2x.com/get-cloudflare-visitor-ips-php/
Reply
#6
Thanks David!

Cheers,

Joe
Reply
#7
I'll take a look at one of the PHP app code to see what they're doing to extract the correct IP. If it's not too difficult, maybe I could put something together.???
GuL
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)