User Tools

Site Tools


cgi_script_to_print_visitor_ip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
cgi_script_to_print_visitor_ip [2011/10/10 17:45]
k2patel
— (current)
Line 1: Line 1:
-<code cgi | index.cgi>​ 
-#​!/​usr/​bin/​perl -wT                                                                                                      ​ 
-use CGI qw(:​standard); ​                                                                                                   
-print "​Content-type:​ text/​html\n\n"; ​                                                                                     
-#print "<​pre>​\n"; ​                                                                                                       ​ 
-if ($ENV{HTTP_X_FORWARDED_FOR}){ ​                                                                                         
-        print $ENV{HTTP_X_FORWARDED_FOR}; ​                                                                               ​ 
-}                                                                                                                        ​ 
-else                                                                                                                      
-{                                                                                                                        ​ 
-        print $ENV{REMOTE_ADDR}; ​                                                                                         
-}                                                                                                                        ​ 
-print "​\n";​ 
-</​code>​ 
  
-Try it here !! 
- 
-<code bash> 
-curl ip.k2patel.in 
-</​code>​ 
cgi_script_to_print_visitor_ip.1318268752.txt.gz ยท Last modified: 2020/08/10 02:28 (external edit)