Jeg får en Internal fejl her - hvorfor !
Hej alle sammen.Når jeg oploader nedenstående stump på min server ( i Ascii ) og cmod´er til 755, så får jeg stadigvæk en internal fejl.
Filen ligger i ../cgi-bin/admin/data og køres herfra !
Her er prg. stumpen.
#!/bin/perl
# -------------------------------------------
#You must EDIT YOUR links.def script BEFORE entering these variable and running this script!
$field_default = "Dansk"; #Put the default value of the new field here. Leave Blank for no default.
$new_field = "14"; #Put the new field number here.
$total_fields = "14"; #Put the last field number here.
#Change these value to match your settings
require "/home/webhotel/rejsebeskrivelser.dk/htdocs/cgi-bin/admin/db_utils.pl";
require "/home/webhotel/rejsebeskrivelser.dk/htdocs/cgi-bin/admin/links.def";
#You shouldn't have to edit below this line
#------------------------------------------
$nfm1 = $new_field - 1;
$ENV{'REQUEST_METHOD'} and (print "Content-type: text/plain\n\n");
open (DB, "<links.db") or print "Unable to open links database 'links.db'. Reason: $!" and exit;
print "\tOpening output file . . .\n";
open (DBOUT, ">links2.db") or print "Unable to open output database. Make sure data dir is chmod 777 temporarily. Reason: $!" and exit;
print "\n\n\tProcessing records\n";
while (<DB> ) {
(/^#/) and next LINE; # Skip comment Lines.
(/^\s*$/) and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@rec_in = &split_decode($_);
# Copy ID, Title, URL, Date and Category
for $i (0 .. $nfm1) {
$rec_out[$i] = $rec_in[$i];
}
# Add New Field
$rec_out[$new_field] = "$field_default";
# Copy the rest of old links.db to new links2.db
for $i ($new_field .. $total_fields) {
$rec_out[$i + 1] = $rec_in[$i];
}
print DBOUT &join_encode(&array_to_hash(0, @rec_out));
}
print "\tDone.\n\n";
close DB;
close DBOUT;
print "Database saved it as links2.db.\n";
print "Change permissions back to 755 on the data directory.\n\n";
print "You must rename 'links2.db' to 'links.db before using with Links v2.\n";
print "It is recommend you save the original 'links.db' before renaming.\n\n";
Fejlmeldingen fra min error log siger : [Sun Mar 31 00:22:29 2002] [error] [client 195.215.114.66] Premature end of script headers: /home/webhotel/rejsebeskrivelser.dk/htdocs/cgi-bin/admin/data/upgrade.pl