This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function getRealIpAddr() { | |
| if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet | |
| $ip = $_SERVER['HTTP_CLIENT_IP']; | |
| } | |
| elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy | |
| $ip = preg_replace('/(?:,.*)/', '',$_SERVER['HTTP_X_FORWARDED_FOR']); | |
| } | |
| else { | |
| $ip = $_SERVER['REMOTE_ADDR']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| Takes a property and a value, and writes it in pixels and rem, to ensure | |
| backward compatibility with (doomed) IE8 and lower | |
| @param $property A valid CSS property | |
| @param $value A numeric value | |
| Use: rem("width", 160) returns: width: 160px; width: 10rem; // Note the quotes in "width" | |
| rem(padding, 10px 10px 0) returns: padding: 10px 10px 0; padding: 0.625rem 0.625rem 0; // note the units | |
| */ |