Ich habe mal wieder ein problem, ich habe eine Skript geschrieben der Lokal auf meinem Rechner wunderbar funktioniert, jedoch, wenn ich in auf den Server von meinem Webspacehoster lege, dann nicht mehr!
Woran kann es liegen?
Hier mal der Quellcode:
#!/usr/bin/perl
#Daten für den Skript
$urlskript = "http://www.seb.esser.space4free.de/cgi-bin/event.test.pl";
$urlhost = "http://www.space4free.de";
$dblockip = '/srv/www/htdocs/web80/html/cgi-bin/lockip.db';
$dblockweb = '/srv/www/htdocs/web80/html/cgi-bin/lockweb.db';
$locktime = 21600; #Sekunden => 6 Stunden
use CGI ("param");
use DB_File;
$webaccount = param("webaccount");
$step = param("step");
$step = $step+1;
$url = "$urlskript"."?webaccount="."$webaccount"."&step="."$step";
$account = "web"."$webaccount";
#Überprüfen, ob die IP noch gesperrt ist
%lockip;
tie(%lockip,'DB_File',$dblockip,O_RDWR|O_CREAT, 0777) or die "Can't tie %lockip with file $dblockip";
$cip = $ENV{'REMOTE_ADDR'};
$ctime = time;
$timediff = $ctime - $lockip{$cip};
if ($timediff > $locktime)
{
untie %lockip;
}
else
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<body>\n";
print "Leider kannst du nicht einen weiteren Klick speichern, da deine IP-Adresse vor weniger<br>\n";
print "als 6 Stunden schon einmal einen Klick gespeichert hat\n";
print "</body>\n";
print "</html>\n";
untie %lockip;
exit;
}
#Überprüfen, ob der User noch gesperrt ist
%lockweb;
tie(%lockweb,'DB_File',$dblockweb,O_RDWR|O_CREAT, 0777) or die "Can't tie %lockweb with file $dblockweb";
$ctime = time;
$timediff = $ctime - $lockweb{$account};
if ($timediff > $locktime)
{
untie %lockweb;
}
else
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<body>\n";
print "Leider kannst du nicht einen weiteren Klick speichern, da dein Account vor weniger<br>\n";
print "als 6 Stunden schon einmal einen Klick gespeichert hat\n";
print "</body>\n";
print "</html>\n";
untie %lockweb;
exit;
}
#Abarbeiten der verschiedenen Steps
if ($step == 1)
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<script type="text/JavaScript">\n";
print "function popup() {\n";
print "F1 = ";
print "window.open("$url","PopUp","menubar=no,toolbar=yes";
print ",scrollbars=yes,status=yes,resizable=yes,location=no,hotkeys=yes,");";
print "}\n";
print "\n</script>\n";
print "</head>\n";
print "<body onload="popup()">\n";
print "Es sollte sich nun ein PopUP öffnen, indem der Event vortgesetzt wird\n";
print "</body>\n";
print "</html>\n";
}
if ($step == 2)
{
open(IN,"account/"."$account");
$statistik = <IN>;
close(IN);
print "Content-type: text/html\n\n";
print "<html>\n";
print "<body>\n";
print "Du hast bereits $statistik Klicks gemacht\n";
print "<br>\n";
print "<form action="$urlskript" method="post">\n";
print "<input type="hidden" name="webaccount" value="$webaccount">\n";
print "<input type="hidden" name="step" value="$step">\n";
print "<input type="submit" value="Zum starten">\n";
print "</form>\n";
print "</body>\n";
print "</html>\n";
}
if ($step == 3)
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<body onunload="pop()">\n";
print "<script type="text/javascript">\n";
print "<!--\n";
print "function pop() {\n";
print "F2 = window.open";
print "("$url","PopUp2","menubar=no,toolbar=yes,scrollbars=yes,stat";
print "us=yes,resizable=yes,location=no,hotkeys=yes,");}\n";
print "//-->\n";
print "</script>\n";
print "<script type="text/javascript"><!--\n";
print "google_ad_client = "pub-5708059318680561";\n";
print "google_ad_width = 125;\n";
print "google_ad_height = 125;\n";
print "google_ad_format = "125x125_as";\n";
print "google_ad_channel ="2610363739";\n";
print "google_color_border = "365275";\n";
print "google_color_bg = "365275";\n";
print "google_color_link = "FFFFFF";\n";
print "google_color_url = "FF8800";\n";
print "google_color_text = "CCCCCC";\n";
print "//--></script>\n";
print "<script "."type="text/javascript" ";
print "src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\n";
print "</script>\n";
print "</body>\n";
print "</html>\n";
}
if ($step == 4)
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<body>\n";
print "<script type="text/javascript">\n";
print "<!--\n";
print "function weiter() {\n";
print "opener.location.href='$url';\n";
print "self.close();\n";
print "}\n";
print "//-->\n";
print "</script>\n";
print "<form>\n";
print "<input type="button" value=" Klicken " onclick="weiter()">\n";
print "</form>\n";
print "</body>\n";
print "</html>\n";
}
if ($step == 5)
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print " <meta http-equiv="refresh" content="0 URL=$url">\n";
print "</head>\n";
print "<body>\n";
print "</body>\n";
print "</html>\n";
}
if ($step == 6)
{
open(IN,"account/"."$account");
$oldnummber = <IN>;
close(IN);
$newnummber = $oldnummber+1;
open(OUT,">account/"."$account");
print OUT "$newnummber";
close(OUT);
%lockip;
tie(%lockip,'DB_File',$dblockip,O_RDWR|O_CREAT, 0777) or die "Can't tie %lockip with file $dblockip";
$cip = $ENV{'REMOTE_ADDR'};
$ctime = time;
$lockip{$cip} = $ctime;
untie %lockip;
%lockweb;
tie(%lockweb,'DB_File',$dblockweb,O_RDWR|O_CREAT, 0777) or die "Can't tie %lockweb with file $dblockweb";
$ctime = time;
$lockweb{$account} = $ctime;
untie %lockweb;
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print " <title> Google Banner Event von Space4free.de </title>\n";
print "</head>\n";
print "<body>\n";
print "<h1>Dein Klick wurde gespeichert</h1>\n";
print "Um zum Anfang zurück zu kehren bitte";
print "<a href="$url"> hier klicken</a>";
print "</body>\n";
print "</html>\n";
}
if ($step == 7)
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<script type="text/javascript">\n";
print "function klick() {\n";
print "opener.location.href='$urlhost';\n";
print "self.close();\n";
print "}\n";
print "</script>\n";
print "</head>\n";
print "<body onload="klick()">\n";
print "</body>\n";
print "</html>\n";
}