Weil mir grad so fad war:
redir.html:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Redirect Test</title>
</head>
<body>
YOU ... WILL ... BE ... R E D I R E C T E D !
<script language="JavaScript1.3">
h = self.outerHeight; w = self.outerWidth;
if( h < 200 || w < 200 ) {
// redirect mit Parameter "zu klein" aufrufen
alert( "KLEIN: " + self.location.host);
location.href="/cgi-bin/redir.pl?parm=toosmall"
} else {
// redirect aufrufen, Fenster nicht zu klein
alert( "OK: " + self.location.host);
location.href="/cgi-bin/redir.pl?parm=ok"
}
alert("FERTIG");
</script>
</body>
</html>
redir.pl
Code:
#!/usr/bin/perl
use strict;
require "cgi-lib.pl";
my($location);
my(%input);
my(%pfui_ips) = {
'194.158.136.43' => 1,
' 64.236.16.116' => 1,
' 209.10.26.51' => 1,
};
&ReadParse(\%input);
if( $input{'parm'} eq 'toosmall') {
$location = "http://www.ananova.com/news/story/sm_358876.html";
} else {
if( defined($pfui_ips{$ENV{REMOTE_ADDR}}) ) {
$location = "http://www.shibumi.org/eoti.htm";
} else {
$location = "http://www.wcm.at";
}
}
print "Status: 302 Found\n";
print "Location: $location\n";
print "URI: <$location>\n";
print "Content-type: text/html\r\n\r\n";
HTH