Update: IP address detection in PHP

We now actually have an even better workaround for the IP address problem I talked about last time.  Near the top of any PHP page,  include the following line:

require_once('wou_web_patch.inc.php');

After that, the normal IP address variable $_SERVER[‘REMOTE_ADDR’] will hold the actual IP instead of one of the four load-balancer addresses.  $_SERVER[‘HTTP_WOU_REAL_IP’] will continue to hold the real IP as well, but you should use the normal variable whenever possible.

By the way, the patch is already included in the WOU standard template, so if you are using those topinclude and bottominclude files, you only need to include the above code if you need the IP address before you call topinclude. Since it uses require_once(), there will be no conflict when the topinclude calls the patch again.

14 thoughts on “Update: IP address detection in PHP

  1. Обменять испорченные (поврежденные) купюры долларов США, евро и другой иностранной валюты в Одессе

  2. The sublimation printer is a revolutionary device that allows you to print photos, documents, and more on any substrate from paper to frosted glass to metal. Gone are the days of printing on flat surfaces. With this printer, you can print anything onto frosted glass, stickers, plaques, and more!

Leave a Reply

Your email address will not be published.