Commits

Ethan Robish committed ed1a957

find ip if user is using a proxy

Comments (0)

Files changed (1)

 // generate md5 sum set to $cid
 $cid = md5("secret" . $_SERVER['REMOTE_ADDR'] . $_SERVER['REMOTE_PORT'] . time() . "secret");
 // get ip set to $eip
-$eip = $_SERVER['REMOTE_ADDR'];
+$eip = '';
+if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARTDED_FOR'] != '') {
+    $eip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+} else {
+    $eip = $_SERVER['REMOTE_ADDR'];
+}
 ?>
 <!-- // Flash doesn't like to be hidden // -->
 <object