======== This one is apparently working, the next one causes me much troubles! It reads all the lines, but aren't print the way I want! How do I manage it??? ======== READIT.PL--THIS IS THE POSTIT.PL---- my $q = new CGI; my $dat = $q->param('data'); my $nom = $q->param('Nom'); my $cog = $q->param('Cognoms'); my $tel = $q->param('Telfix'); my $mob = $q->param('Telmov'); my $ciu = $q->param('Ciutat'); my $pro = $q->param('Provincia'); my $url = $q->param('url'); my $ema = $q->param('Email'); my $hor = $q->param('Horari'); my $art = $q->param('Article'); my $com = $q->param('Comentaris'); my $pvp = $q->param('Preu'); my $string = join('|',$data, $nom, $cog, $ciu, $pro, $art, $pvp, $tel, + $mob, $ema, $url, $com); open (LOG, ">>anuncis.txt") || Error ('open', 'file'); flock (LOG, 2) || Error ('lock', 'file'); print LOG $string, "\n"; close LOG;
use strict; print "Content-type: text/html\n\n"; open LOG, "anuncis.txt" || die "$!"; while (<LOG>) { chomp; my @attributes = split /\|/; for my $attribute (@attributes) { print "Anunci: $attribute, \n"; } } close LOG;
Edit kudra, 2002-06-13 Changed title
In reply to Printing a log file in a CGI script
by Kuntent
in thread Reading data from a document.txt
by Kuntent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |