I am trying to do an automatic lookup of hosts when someone attempts to SPAM my scripts in my site...I have added the following codes:
my $remote_address = $ENV{'HTTP_REFERER'};
my $check_host = system("nslookup $remote_address");
print "$check_host";
Also, I am using print MAIL "$check_host"; in mail scripts.
The problem is that the domain name and IP addresses do print in the web page, yet the codes print at the top of the screen with 0 printed where the NSLOOKUP results should print. Also, 0 is only sent via email.
I tried using:
$check_host = $i;
Then nothing printed.
I did search the perldocs in my server and also at http://www.perl.com and http://www.cpan.org to see if there were any Perl modules that I could use rather than using system to run another application.
Any suggestions are welcome.
Thanks in advance.
Regards,
Eliot Lee
Code:
my $remote_address = $ENV{'HTTP_REFERER'};
my $check_host = system("nslookup $remote_address");
print "$check_host";
Also, I am using print MAIL "$check_host"; in mail scripts.
The problem is that the domain name and IP addresses do print in the web page, yet the codes print at the top of the screen with 0 printed where the NSLOOKUP results should print. Also, 0 is only sent via email.
I tried using:
Code:
$check_host = $i;
Then nothing printed.
I did search the perldocs in my server and also at http://www.perl.com and http://www.cpan.org to see if there were any Perl modules that I could use rather than using system to run another application.
Any suggestions are welcome.
Thanks in advance.
Regards,
Eliot Lee