Yossi has asked for the wisdom of the Perl Monks concerning the following question:
that was the submit code (the "print"s are transleted to english) the view code is:#! /usr/bin/perl $in; if ($ENV{'REQUEST_METHOD'} eq "get") { $in = $ENV{'QUERY_STRING'}; } else { $in = <STDIN>; } $in =~ s/\+/ /g; @detail = split (/&/, $in); print "Content-Type: text/html\n\n"; print "<html><body>Post has succsesfully submited"; foreach $details(@detail) { %details = split (/=/, $details); while (($name, $value) = each %details) { print "<br>\n"; $entry .= $value . "#"; } } print "click <a href=view.cgi>here</a> to view your post</body></html> +"; $entry = $entry."\n"; open (GBOOK, ">> guestbook.txt"); print GBOOK "$entry"; close (GBOOK);
an online failure at http://dotkof.org/yossi#! /usr/bin/perl open (GBOOK, "guestbook.txt"); @entries = <GBOOK>; close (GBOOK); print "Content-Type: text/html\n\n"; print "<html><body>"; foreach $entry(@entries) { @singles = split (/#/, $entry); print "$singles[0]\n"; print "<BR><BR>\n"; } print "</body></html>";
Edit of title by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Charecters problems
by tachyon (Chancellor) on Jul 22, 2001 at 05:11 UTC | |
by Yossi (Initiate) on Jul 22, 2001 at 07:13 UTC |