comparison _xampp/guestbook-es.pl @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b12c99b7c3f0
1 #!/opt/lampp/bin/perl
2
3 # Copyright (C) 2002/2003 Kai Seidler, oswald@apachefriends.org
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19
20 use CGI;
21
22 $form=new CGI;
23
24 $f_name=CGI::escapeHTML($form->param("f_name"));
25 $f_email=CGI::escapeHTML($form->param("f_email"));
26 $f_text=CGI::escapeHTML($form->param("f_text"));
27
28 print "Content-Type: text/html\n\n";
29
30 if($f_name)
31 {
32 open (FILE, ">>guestbook.dat") or die ("No se puede abrir el fichero del Libro de Visitas");
33 print FILE localtime()."\n";
34 print FILE "$f_name\n";
35 print FILE "$f_email\n";
36 print FILE "$f_text\n";
37 print FILE "·\n";
38 close(FILE);
39 }
40
41 print '<html>';
42 print '<head>';
43 print '<meta name="author" content="Kai Oswald Seidler">';
44 print '<link href="xampp.css" rel="stylesheet" type="text/css">';
45 print '</head>';
46
47 print '<body>';
48 print '&nbsp;<p>';
49
50 print "<h1>Libro de Visitas (Ejemplo de Perl)</h1>";
51
52 print "Un clasico y simple Libro de Visitas!";
53
54 open (FILE, "<guestbook.dat") or die ("No se puede abrir el fichero del Libro de Visitas");
55
56 while(!eof(FILE)){
57 chomp($date=<FILE>);
58 chomp($name=<FILE>);
59 chomp($email=<FILE>);
60
61 print "<p class=small>$date";
62 print "<table border=0 cellpadding=4 cellspacing=1>";
63 print "<tr><td class=h>";
64 print "<img src=img/blank.gif width=250 height=1><br>";
65 print "Nombre: $name";
66 print "</td><td class=h>";
67 print "<img src=img/blank.gif width=250 height=1><br>";
68 print "E-Mail: $email";
69 print "</td></tr>";
70 print "<tr><td class=d colspan=2>";
71 while(1==1){
72 chomp($line=<FILE>);
73 if($line eq '·') {
74 last;
75 }
76 print "$line<br>";
77 }
78 print "</td></tr>";
79 print "</table>";
80 }
81 close (FILE);
82
83 print "<p>Aņadir";
84
85 print "<form action=guestbook-es.pl method=get>";
86 print "<table border=0 cellpadding=0 cellspacing=0>";
87 print "<tr><td>Nombre:</td><td><input type=text size=30 name=f_name></td></tr>";
88 print "<tr><td>E-Mail:</td><td> <input type=text size=30 name=f_email></td></tr>";
89 print "<tr><td>Texto:</td><td> <textarea type=text rows=3 cols=30 name=f_text></textarea></td></tr>";
90 print "<tr><td></td><td><input type=submit border=0 value=\"GRABAR\"></td></tr>";
91 print "</table>";
92 print "</form>";
93
94
95 print "</body>";
96 print "</html>";