-
Notifications
You must be signed in to change notification settings - Fork 0
/
PHATAlaskan-Error-404.cgi-pl
executable file
·33 lines (26 loc) · 1.5 KB
/
PHATAlaskan-Error-404.cgi-pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl
use LAM::LAM qw(displaySource displayPage); # Lexicon Abstact Map
use CGI qw(:all); # Perl Common Gateway Interface package
use strict; # Force me to use strict variable syntax.
use warnings; # Enable warnings.
LAM::displaySource( # Display source, rlog, etc. if requested.
"https://github.com/LAMurakami/no-ssl/blob/master/html/Public/Scripts/PHATAlaskan-Error-404.cgi-pl");
my $errorType = '404 Not Found!'; # 404 Page Not Found! http server error
my $m1 = '<h2> The requested page was not found.'
. "</h2>\n"; my $m2 = <<ENDm2;
<p>
If you are not sure it is on this site you could try <a href="/Google">
a search engine</a> or <a href="http://en.wikipedia.org/wiki/Main_Page">
<img src="/Images/Wikipedia-logo-en.png" alt="Wikipedia" border=0></a>
ENDm2
; my $referer = '<br><br>'; my $m3 = <<ENDm3;
Check for errors in the URL.
ENDm3
; my $uriD = $ENV{REQUEST_URI};
if (length($uriD) > 50) {$uriD = substr($uriD,0,50).'...'}
my $uri = p(). h3('Request: '. a({-href=>$ENV{REQUEST_URI}}, "\n". $uriD)."\n");
if ($ENV{HTTP_REFERER}) { my $hRef = $ENV{HTTP_REFERER}; my $dhRef = $hRef;
if (length($dhRef) > 50) {$dhRef = substr($dhRef,0,50).'...'}
$referer = h3('Referer: '. a({-href=>$hRef}, "\n" . $dhRef) . "\n")}
LAM::displayPage('-c', '-t', 'PHATAlaskan', 'PHATAlaskan'
, "\n$m1\n$uri\n\n$referer\n\n$m3$m2<br><br>$errorType")