Files
scripts/Webseiten/bildergallerie/scripts/tellfriend.pl
2024-10-14 00:08:40 +02:00

51 lines
1.2 KiB
Perl

#!/bin/perl
# tellfriend.pl
use strict;
use CGI qw(:standard);
use myHTML;
#print header();
my $action = param('action');
my $mailad = param('mail');
my $from = param('from');
p "<html>";
p "<head>";
p "<title>Weiterempfehlen</title>";
p "</head>";
p "<body>";
if ($action eq "form") {
# Formular anzeigen
p2 "<form action='./tellfriend.pl?action=send' method='post'>",
" <table>",
" <tr>",
" <td>An</td>",
" <td><input type='text' name='mail'></td>",
" <td>eMail Adresse angeben!</td>",
" </tr>",
" <tr>",
" <td>Von</td>",
" <td><input type='text' name='from'></td>",
" <td>Name angeben!</td>",
" </tr>",
" </table>",
"<input type='submit' name='action' value='Senden'>",
"</form>";
}
if ($action eq "Senden") {
# write_log ("tellafriend","von $from an $mailad");
`echo "Hallo,\n\nSchau dir mal die Webseite http://www.bildergallerie.de an.\n\nGruß $from" | mailx -s "Website Empfehlung" $mailad`;
p2 "E-Mail an $mailad gesendet!<br>",
"<input type='submit' name='action' value='Schließen' onclick=\"window.close();\">";
}
p2 "</body>",
"</html>";