Last active
June 26, 2016 02:43
-
-
Save AJNOURI/afa8475340a2bc8a0e44 to your computer and use it in GitHub Desktop.
php inside html to detect ip address
This file contains 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 | |
header('Content-Type: text/plain'); | |
echo "Server IP: ".$_SERVER['SERVER_ADDR']; | |
echo "\nClient IP: ".$_SERVER['REMOTE_ADDR']; | |
echo "\nX-Forwarded-for: ".$_SERVER['HTTP_X_FORWARDED_FOR']; | |
?> |
This file contains 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
<div class="content_section floating_element"> | |
<div class="section_header section_header_red"> | |
<div id="about"></div> | |
It works! | |
<p> | |
<?php | |
echo "Local server IP = ".$_SERVER['SERVER_ADDR']; | |
?> | |
</p> | |
<p> | |
<?php | |
echo "IP used by client = ".$_SERVER['HTTP_HOST']; | |
?> | |
</p> | |
<p> | |
<?php | |
echo "DNS name used by client = ".$_SERVER['SERVER_NAME']; | |
?> | |
</p> |
This file contains 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 | |
header('Content-Type: text/plain'); | |
echo "Server IP: ".$_SERVER['SERVER_ADDR']; | |
echo "\nClient IP: ".$_SERVER['REMOTE_ADDR']; | |
echo "\nIP used by client = ".$_SERVER['HTTP_HOST']; | |
echo "\nX-Forwarded-for: ".$_SERVER['HTTP_X_FORWARDED_FOR']; | |
echo "\nDNS name used by client = ".$_SERVER['SERVER_NAME']; | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment