#!/usr/bin/perl # DO NOT EDIT code below this line!! # The first line above must be a call to the location of your PERL 5 program. # This MUST BE CORRECT - view installed scripts or consult Hosts Manual. # FTP upload as an ASCII file to your CGI-BIN and set permissions to chmod 755 # CALL as "http://www.yourdomain.name/cgi-bin/testbin.cgi # CHANGE this next line to the correct URL to this program $sriptURL = "http://www.xodoma.org/cgi-bin/admin/testbin.cgi"; # DO NOT LEAVE this program on your site - delete after use!!! # Australian/International copyright Ron F Woolley 2000 $field{'mailpth'} = "/usr/lib/sendmail"; my $cnvrt; my $boo = " 
"; &GetFormInput; &is_mail if $field{'mailpth'} && $field{'email'} && $field{'send'}; print "Content-Type: text/html\n\n"; open (FLE, $0);@p1 = ;close (FLE);($pl = $p1[0]) =~s/\n//g if $p1[0] =~ /^#!\//; if (-e "C:/" || $^O =~ /MSWin32/i) {$is32 = " on Win32:NT!";} if (($ENV{'REMOTE_ADDR'} eq $ENV{'REMOTE_HOST'} || !$ENV{'REMOTE_HOST'}) && $ENV{'REMOTE_ADDR'} =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) { $pk = pack('C4', $1, $2, $3, $4); $cnvrt = (gethostbyaddr($pk, 2))[0]; if ($cnvrt) {$ENV{'REMOTE_HOST'} = $cnvrt;} } if ($] =~ /^5/ && !$is32) { $t1 = "

If you can read this page then the cgi-bin and
this script have executed without errors. Your
CGI-BIN is set up and working correctly.

If installing dtp-aus.com scripts, you can now
try the makedir.cgi script to create directories
and empty files, ready for FTP uploading of all
the files supplied (see readme.htm)."; } elsif ($] && $] !~ /^5/ && !$is32) { $t1 = "

If you can read this page then the cgi-bin and
this script have executed without errors. Your
CGI-BIN is set up and working correctly.

However, $pl is
is NOT calling Perl versions 5. My dtp-aus.com
scripts are written for Perl Version 5. Contact
your Host Service for the correct path to Perl 5
on your server.
"; } elsif ($is32) { $t1 = "

My dtp-aus.com Perl 5 scripts are not written for
MS NT, nor do they currently receive any support
for that operating system.

But, if you can read this page then the cgi-bin
and this script have executed without errors. Your
CGI-BIN is set up and working correctly."; } elsif (!$]) { $t1 = "

Your Perl Version could not be ascertained
for installation verification.

But, if you can read this page then the cgi-bin
and this script have executed without errors. Your
CGI-BIN is set up and working correctly."; } else {$t1 = "

Details could not be ascertained.";} print qq~Unix CGI-BIN Perl 5 Test

$boo
$pl
Perl $]$is32
Absolute path : $ENV{'SCRIPT_FILENAME'}
$t1

Thank You
Ron Woolley - www.dtp-aus.com / www.hostingnet.com

 
If the latest v5 of perl is not reported above, try another (first line, top of the script).
   ** From most servers a list should have been created below.
 
To check your Sendmail program, enter the path in the first box.
IF A CRASH OCCURS then use the back arrow to return and try another. BUT IF this
page reappears then check your e-mail where a simple letter should arrive within minutes.
 
The PATH to your servers "Sendmail" program
Your E-Mail address ( double check it )
  *   malfunctioning server Sendmail set up can receive without error BUT not send!!
NOTE: Some servers might report the Sendmail path below.
  ** perl paths may be listed below from some servers but not the sendmail path.
~; print qq~

~; $mprog =`whereis sendmail`; $path =`whereis perl`; @chked1 = split(" ",$mprog); @chked2 = split(" ",$path); $is = `which perl`; $mis = `which sendmail`; print qq~

Perl Path(s)
~; foreach $s2 (@chked2) {print "• $s2
";} print qq~Default Perl : $is
Sendmail Path(s)
~; foreach $s2 (@chked1) {print "• $s2
";} print qq~Default Sendmail : $mis


~; exit(0); sub is_mail { my ($mprog,$rec,$tm); $tm = localtime(time); $mprog = "$field{'mailpth'}"; $rec = "$field{'email'}"; if (open (MAIL, "|$mprog -t")) { print MAIL "To: $rec\n"; print MAIL "From: $rec\n"; print MAIL "Subject: TESTBIN.CGI\n"; print MAIL "\n\n"; print MAIL "--------------------------------\n" ; print MAIL " This is just test blurb.\n Your Sendmail path worked!!\n \"$field{'mailpth'}\"\n" ; print MAIL "--------------------------------\n" ; print MAIL " IP# < $ENV{'REMOTE_ADDR'} >\n Host < $ENV{'REMOTE_HOST'} >\n $tm\n\n"; close (MAIL); $boo = "

Mail 'attempt' passed - check your mail

"; } else {$boo = "

Could not open Sendmail!

";} } sub GetFormInput { if ( $ENV{'REQUEST_METHOD'} eq 'GET' ) { $buffa = $ENV{'QUERY_STRING'}; } elsif ( $ENV{'REQUEST_METHOD'} eq 'POST' ) { read(STDIN,$buffa,$ENV{'CONTENT_LENGTH'}); } else { print "Content-Type: text/html\n\n"; print "OOOPs!

Use ONLY GET or POST method!

"; exit(0);} @bvals = split(/&/,$buffa); foreach $i (0 .. $#bvals){ ($name,$val) = split (/=/,$bvals[$i],2); $val=~tr/+/ /; $val=~ s/%(..)/pack("c",hex($1))/ge; $name=~tr/+/ /; $name=~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/~!/ ~!/g; $val =~ s/`//g; $val =~ s/<([^>]|\n)*>//g; $name =~ s///g; $val =~ s///g; $field{$name} = $val; } }