• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

Perl

sk8graz

New member
folgendes problem:


http://www.sk8graz.f2s.com/spiele/moorhexe/cgi/high.pl


Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@sk8graz.f2s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.19 Server at www.sk8graz.f2s.com Port 80






ich habe (meiner meinung nach keinen scriptfehler gemacht:
(is'n leiscript)
_____________________________________________
#!/usr/bin/perl

##########################################################
# #
# Moorhexe-Highscore CGI: 1.4 #
# Last Modified: 20.Apr.00 #
# Written By: Thomas Pfeifer #
# http://thopf.purespace.de/start.htm #
# #
##########################################################
# #
# Please read liesmich.txt / readme.txt first ! #
# #
##########################################################
# #
# Re-distribution of this program is strictly prohibited #
# without the written consent of Thomas Pfeifer. #
# #
##########################################################

#========================================
# V A R I A B L E S T O E D I T

# Check the Perl-path at the top


# The file that hold the Highscores
# The directory must be chmoded to read/write(644)
$highfile="high.txt";

# logfile
$logfile="log.txt";





# CGI-lib needed
use CGI param,referer,remote_host,request_method,user_agent;

$anz=50;
$score=param("score");
$name=param("name");
$time=param("fps");
$ref=param("ref");
$ver=param("v");

($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($mday < 10) { $mday = "0$mday"; }
$year += 1900;
$date = ($mday+1).".".($mon+1).".".($year)." ".$hour.":".$min.":".$sec;

$log=$date.",".request_method().",".remote_host().",".referer().",".user_agent().",".$score.",".$name.",".$time.",".$ref.",".$ver;

# Simple HTTP-Header
print "Content-type: text/plain\n\n";

# get Highscores
open (HIGH,"$highfile") || ($log.="\nError open: $highfile");
@lines=<HIGH>;
close(HIGH);

# cut returns
chomp(@lines);

# POST Variables and Version Check
if ($score>0 && $name && $time && $ver>=127) {

# generate Hash
$namelen=length($name);
$hash=0;
for ($i=0;$i<$namelen;$i++) {
$hash+=ord(substr($name,$i,1))-$i;
}

# encode hash
$hash=$hash^$score^2111;

#test Hash
$_=$name;

#forbidden names
#i dont like URLs in my Highscore
if(/www/i || /\.de/i || /\.com/i || /\.net/i || /\.to/i || /sex/i || /porn/i || /fick/i || /fuck/i || /\.vu/i || /\.ch/i || /\.at/i) {
$log.="\nbad name: $_";
} else {
if ($hash==$time) {
#put in the score
$n=-1;
for ($i=0;$i<$anz*2;$i+=2) {
if ($lines[$i+1]<=0) {
$lines[$i]="nobody";
$lines[$i+1]="0";
}
if ($lines[$i] eq $name && $lines[$i+1]==$score) {
$n=-2;
$log.="\ninList";
}
if ($score>=$lines[$i+1] && $n==-1) {
$n=$i;
}
}
if ($n>=0) {
splice @lines,$n,0,$score;
splice @lines,$n,0,$name;
}
open (OUT,">$highfile") || ($log.="\nError write $highfile");
for ($i=0;$i<$anz*2;$i++) {
print OUT "$lines[$i]\n";
}
close(OUT);
} else {
$log.="\nwrong hash";
}
}
} else {
$log.="\nheader error";
}

# print out the Scores
for ($i=0;$i<$anz*2;$i++) {
print "$lines[$i]\n";
}

# write and print log
open (LOG,">>$logfile") || print STDERR "\nError write $logfile : $log";
print LOG "$log\n";
close (LOG);
print $log;
_____________________________________________

hmmm

mein log.txt und hight.txt liegt im cgi Verzeichniss
________

Bitte helft mir ich bin verzweifelt


mfg sk8graz
 
Zurück
Oben