Moin,
hab ein guestbook runtergeladen (nms) und es soweit zum laufen gebracht. Nun noch folgendes: Es werden die Formular-Felder auf Inhalt geprüft. Wenn man keinen Namen, etc. eingibt, taucht ne Fehlermeldung auf.
Diese Fehlermeldung hätte ich gerne in einem neuen Fenster. Was muss ich tun?
Es folgt der betreffende Auszug aus dem Quelltext: (Wahrscheinlich zu viel, aber sicher ist sicher. ich meine Die Meldung "The comment section in the guestbook fillout form appears
to be blank ....."
$_ .= "\n<!-- comment end -->\n";
$_ .= "<!--begin-->\n" unless $entry_order;
}
}
);
write_log('entry') if $uselog;
my $mailsafe_username =
( check_email( $inputs{username} ) ? $inputs{username} : '' );
my $mailsafe_realname = cleanup_realname( $inputs{realname} );
if ($mail)
{
my $to = $recipient;
my $from = "$mailsafe_username ($mailsafe_realname)";
my $reply = "$mailsafe_username ($mailsafe_realname)";
my $subject = 'Entry to Guestbook';
my $body = 'You have a new entry in your guestbook:';
do_mail( $to, $from, $reply, $subject, $body );
}
if ( $remote_mail && $mailsafe_username )
{
my $to = $mailsafe_username;
my $from = $recipient;
my $reply = $recipient;
my $subject = 'Entry to Guestbook';
my $body = 'Thank you for adding to my guestbook.';
do_mail( $to, $from, $reply, $subject, $body );
}
Print Out Initial Output Location Heading
if ($redirection)
{
print redirect($guestbookurl);
}
else
{
no_redirection();
}
sub form_error
{
my ($why) = @_;
my ( $title, $heading, $text, $comments_field );
if ( $why eq 'no_name' )
{
$inputs{realname} = '';
$escaped{realname} = '';
$title = 'No Name';
$heading = 'Your Name appears to be blank';
$text = <<EOTEXT;
The Name Section in the guestbook fillout form appears to
be blank and therefore your entry to the guestbook was not
added. Please add your name in the blank below.
EOTEXT
$comments_field = <<EOCOMMENT;
Comments have been retained.
<input type="hidden" name="comments" value="$escaped{comments}" />
<input type="hidden" name="comments_encoded" value="1" />
EOCOMMENT
}
elsif ( $why eq 'no_comments' )
{
$title = 'No Comments';
$heading = 'Your Comments appear to be blank';
$text = <<EOTEXT;
The comment section in the guestbook fillout form appears
to be blank and therefore the Guestbook Addition was not
added. Please enter your comments below.
EOTEXT
$comments_field = <<EOCOMMENT;
Comments:<br />
<textarea name="comments" cols="60" rows="4"></textarea>
EOCOMMENT
}
else
{
$title = 'Unknown Error';
$heading = 'Something appears to be wrong with your submission';
$text = 'Please check your input and resubmit';
$comments_field = <<EOCOMMENT;
Comments:<br />
<textarea name="comments" cols="60" rows="4">$escaped{comments}</textarea />
<input type="hidden" name="comments_encoded" value="1" />
EOCOMMENT
}
print "Content-Type: text/html; charset=iso-8859-1\n\n";
$done_headers++;
print <<END_FORM;
Vielen Dank!
moe