Basti: Htmlinhalte überschreiben...

Beitrag lesen

Hallihallo erstmal...

Ich ahbe ein Problem, und zwar möchte ich in einer HTML-Datei, die Zeile <!--NEWS--> mit den neuen news überschreiben, sodass ich immer die neuen news oben anfüge... Doch Leider macht er gar nichts! Entweder die Datei ist leer oder es passiert nichts...

Was muss ich da ändern?

MEIN QUELLCODE:

#!/usr/bin/perl

@Formular = ("");

read(STDIN, $Input, $ENV{'CONTENT_LENGTH'});
unless($Input =~ /news/)
 {
  print "Content-type: text/html\n\n";
  print "<html><head><title>.:: Twinsmania Syndicate ::.</title></head>\n";
  print "<body link=#ffffff vlink=#ffffff alink=#ffffff bgcolor=#dce0d3 text=#344011>\n";
  print "<table bgcolor=#dce0d3 border=0 width=250 cellspacing=0 cellpadding=0><tr><td bgcolor=#9ea985><center>:| NEWSBEREICH |:</td></tr><tr><td><center>\n";
  print "<form action="\cgi-bin/news.pl" method=post>\n";
  print "<center><table width=100%><tr><td align=center><b>Datum:</b><br><input style="font-size: 10pt; font-family: Lucida console; border: 3 solid #bbc2a9;background-color:#dce0d3;color:#344011" type=text name="datum" maxlength=15 size=15> </textarea></td></tr>\n";
  print "<tr><td align=center><b>Autor:</b><br><input style="font-size: 10pt; font-family: Lucida console; border: 3 solid #bbc2a9;background-color:#dce0d3;color:#344011" type=text name="autor" maxlength=15 size=15></td></tr>\n";
   print "<tr><td align=center><b>Thema:</b><br><input style="font-size: 10pt; font-family: Lucida console; border: 3 solid #bbc2a9;background-color:#dce0d3;color:#344011" type=text name="thema" maxlength=15 size=30></td></tr></table>\n";
  print "<div align=center><b>News:</b><br><textarea name="news" style="font-size: 10pt; font-family: Lucida console; border: 3 solid #bbc2a9;background-color:#dce0d3;color:#344011" rows=7 cols=30></textarea></div>\n";
  print "<input style="font-size: 10pt; font-family: Lucida console; border: 3 solid #bbc2a9;background-color:#dce0d3;color:#344011" type=submit value="Absenden">\n";
  print "<input style="font-size: 10pt; font-family: Lucida console; border: 3 solid #bbc2a9;background-color:#dce0d3;color:#344011" type=reset value="Abbrechen">\n";
  print "</form></body></html>\n";
  exit(0);
 }
else
 {
@Formularfelder = split(/&/, $Input);
foreach $Feld (@Formularfelder)
 {
  ($name, $value) = split(/=/, $Feld);
  $value =~ tr/+/ /;
  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  $value =~ s/<!--(.|\n)*-->//g;
  $Formular[$i] = $name;
  $i = $i + 1;
  $Formular[$i] = $value;
  $i = $i + 1;
 }
  open(NEWS, ">>..//news.html") || die "[ news.html ] nicht gefunden!\n";
while(<NEWS>)
 {
  $Text = ($_);
  if ($Text eq "<!--NEWS-->")
  {
  $Text =~ s/<!--NEWS-->/[ NEUER TEXT ]/g;
     }
close(NEWS);
 }
   }

Ist da irgendwo ein Fehler?!?

BITTE HELFT MIR !!!