python | KutuKupret » KutuKupret
Aug 182010
 

See http://code.google.com/p/ipaddr-py/

With this, we can do

py> p=ipaddr.IPv6("2001:888:2000:d::a2")
py> p.SetPrefix(64)
py> p
IPv6('2001:888:2000:d::a2/64')
py> p.network_ext
'2001:888:2000:d::'
Share
Sep 222009
 

There are many ways, scripting/language to obtain remote IP address of the user who is browsing our website.

PERL

#!/usr/bin/perl
use CGI;
print "Content-type: text/plain; charset=iso-8859-1\n\n";
my $q = new CGI;
print "<b>Your Remote IP Address :" . $q->remote_host() . "</b>";

PHP

<?php
echo "<b>Your Remote IP Address :" . $_SERVER['REMOTE_ADDR'] . "</b>";
?>

Continue reading »

Share