jtown
08-10-2000, 07:54 AM
How do I log a viewer's IP address?
thanks
james
big_wreck
08-10-2000, 02:11 PM
Hi,
the correct syntax is $ENV(REMOTE_ADDR), assuming you use a generic type input parser ie from a form like:
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
hope that helps.
jtown
08-10-2000, 04:59 PM
ok cool..thanks for the help....does anyone know of any good cgi-perl resources on the web???...I don't really want to buy a book.
big_wreck
08-10-2000, 05:28 PM
http://www.cgi-resources.com
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.