B
Bryce
Can anyone help me modify this Perl script?
#!/usr/bin/perl
use CGI ':standard';
$query = new CGI;
print redirect($query->param("url"));
I need it to send a standard 404 response (instead of the standard redirect()
seen above) if the "url" GET parameter was non-existent or null, or if the HTTP
Referer didn't contain the case insensitive substring "mysite.com/thisurl.php".
I like helping myself and tried my best using tutorials to do this on my own.
Alas, my attempts have failed. Nothing but 500 server errors. E.g.:
#!/usr/bin/perl
use CGI ':standard';
$query = new CGI;
$destination = $query->param("url")
$origin = $ENV{'HTTP_REFERER'}
if ($destination !eq '' && $origin =~ /mysite\.com\/thisurl\.php/) {
print redirect($destination);
} else {
print "Status: 404 Not Found\n\n";
}
Many thanks, and apologizes in advance for my n00bness.
#!/usr/bin/perl
use CGI ':standard';
$query = new CGI;
print redirect($query->param("url"));
I need it to send a standard 404 response (instead of the standard redirect()
seen above) if the "url" GET parameter was non-existent or null, or if the HTTP
Referer didn't contain the case insensitive substring "mysite.com/thisurl.php".
I like helping myself and tried my best using tutorials to do this on my own.
Alas, my attempts have failed. Nothing but 500 server errors. E.g.:
#!/usr/bin/perl
use CGI ':standard';
$query = new CGI;
$destination = $query->param("url")
$origin = $ENV{'HTTP_REFERER'}
if ($destination !eq '' && $origin =~ /mysite\.com\/thisurl\.php/) {
print redirect($destination);
} else {
print "Status: 404 Not Found\n\n";
}
Many thanks, and apologizes in advance for my n00bness.