Pitäisi saada sellanen javaskript että kun on täyttänyt lomakkeen ja painaa LÄHETÄ nappia niin aukeaisi kiitos sivu. Minun oma tekemäni.
Millaista tagia pitäisi käyttää? Ja mihin kohtaan tämä tagi tulisi sijoittaa?
kiitos.
Millaista tagia pitäisi käyttää? Ja mihin kohtaan tämä tagi tulisi sijoittaa?
kiitos.
Vastaukset 2
Vanhimmat
http://keskustelu.suomi24.fi/show.fcgi?category=108&subcat=1128
Kysy Googlelta, mutta esim::
http://www.geocities.com/SiliconValley/7116/
Lomakkeissa kullä yleensä käytetään cgi-scriptiä (form-mail) joka konfiguroidaan, sijoitetaan palvelimelle ja formisi ottaa siihen yhteyden:
#!/opt/perl/bin/perl
#
# Settings
#
#$sendmail = "/usr/lib/sendmail -odq -t";
$sendmail = "/usr/lib/sendmail -t";
$conffile = '../form-mail.conf';
open (CONF, "< " . $conffile);
while () {
chop;
next if (/^$/ || /^;/ || /^#/);
($key, $value) = split(/=/);
$key =~ tr/[A-Z]/[a-z]/;
if ($key eq "form") {
if ($id ne "") {
$recipient{$id} = $rec;
$redirect{$id} = $red;
$subject{$id} = $sub;
$header{$id} = $hea;
}
$id = $value;
undef $rec;
undef $red;
undef $sub;
undef $hea;
}
if ($key eq "recipient") { $rec = $value; }
if ($key eq "redirect") { $red = $value; }
if ($key eq "subject") { $sub = $value; }
if ($key eq "header") { $hea .= $value . "\n"; }
}
if ($id ne "") {
$recipient{$id} = $rec;
$redirect{$id} = $red;
$subject{$id} = $sub;
}
close CONF;
#
# Read the form content
#
read (STDIN, $buffer, $ENV{"CONTENT_LENGTH"});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
$pair =~ tr/+/ /;
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
push (@form, $name . ": " . $value);
$form{$name} = $value;
}
if (!defined $ENV{"PATH_INFO"}
|| $ENV{"PATH_INFO"} =~ m,^[\s/]*$,) {
$key = $form{'form-mail-id'};
} else {
$key = $ENV{"PATH_INFO"};
}
#
# Find the options for the form
#
$recipient = $recipient{$key};
$redirect = $redirect{$key};
$subject = $subject{$key};
$header = $header{$key};
if ($recipient eq "") {
print "Content-type: text/html\n\n";
print "Oops\n";
print "Unknown form configuration\n";
print "The form you have just filled has not been configured to exist. Please contact helpdesk\@eunet.fi for further information. \n";
print "Please provide the following information in the problem report: \n";
print "\n";
print "Form id: $key\n";
print "Referred from URL: " . $ENV{"HTTP_REFERER"} . "\n";
print "\n";
print "helpdesk\@eunet.fi\n";
exit 0;
}
#
# Send form by mail to the administrator
#
open (MAIL, "| " . $sendmail);
print MAIL "From: webmaster\@eunet.fi (EUnet Webmaster)\n";
print MAIL "To: " . $recipient . "\n";
if ($form{"email"} ne "" && $form{"email"} =~ /\@/) {
print MAIL "Reply-to: " . $form{"email"} . "\n";
} else {
print MAIL "Reply-to: " . $recipient . "\n";
}
print MAIL $header;
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: TEXT/PLAIN; charset=ISO-8859-1\n";
print MAIL "Content-Transfer-Encoding: 8BIT\n";
print MAIL "Subject: " . $subject . "\n\n";
print MAIL "------------------------------------------------------------\n";
foreach $value (@form) {
print MAIL $value . "\n";
}
print MAIL "------------------------------------------------------------\n";
print MAIL "To: " . $recipient . "\n";
if ($ENV{"HTTP_USER_AGENT"} ne "") {
print MAIL "Client: " . $ENV{"HTTP_USER_AGENT"} . "\n";
}
if ($ENV{"HTTP_REFERER"} ne "") {
print MAIL "Refered-from-URL: " . $ENV{"HTTP_REFERER"} . "\n";
}
if ($ENV{"REMOTE_HOST"} ne "") {
print MAIL "Client-hostname: " . $ENV{"REMOTE_HOST"} . "\n";
}
if ($ENV{"REMOTE_ADDR"} ne "") {
print MAIL "Client-address: " . $ENV{"REMOTE_ADDR"} . "\n";
}
close MAIL;
#
# Check redirect URL
#
if ($redirect !~ /:/) {
$referer = $ENV{"HTTP_REFERER"};
$referer =~ s,[^/]+$,,;
$redirect = $referer . $redirect;
}
print "Location: " . $redirect . "\n";
print "Content-type: text/html\n\n";
print "Document moved\n";
print "Document moved\n";
print "This document has moved here.\n";
print "\n";
exit 0;